py/compile: Raise SyntaxError if positional args are given after */**.
In CPython 3.4 this raises a SyntaxError. In CPython 3.5+ having a
positional after * is allowed but uPy has the wrong semantics and passes
the arguments in the incorrect order. To prevent incorrect use of a
function going unnoticed it is important to raise the SyntaxError in uPy,
until the behaviour is fixed to follow CPython 3.5+.
diff --git a/py/compile.c b/py/compile.c
index 3b6a264..86ec4d3 100644
--- a/py/compile.c
+++ b/py/compile.c
@@ -2308,6 +2308,10 @@
}
} else {
normal_argument:
+ if (star_flags) {
+ compile_syntax_error(comp, args[i], "non-keyword arg after */**");
+ return;
+ }
if (n_keyword > 0) {
compile_syntax_error(comp, args[i], "non-keyword arg after keyword arg");
return;