summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2017-08-30 11:26:05 +1000
committerDamien George <damien.p.george@gmail.com>2017-08-30 11:26:05 +1000
commit4ddb838f8b03bfbbce0b7c1ffec4cf1dd1f34ec6 (patch)
treeb61eb2fe1478a1e391bf00af0f125b2ccf59cdcf
parentd7576c4ba798f5067d9f07c745a4ab059b1121ea (diff)
py/compile2: Raise SyntaxError if positional args are given after */**.
A port of 1e70fda69fcb4991eb60ed43e610f664ea1319e6
-rw-r--r--py/compile2.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/py/compile2.c b/py/compile2.c
index 94a759170..b22ae8b94 100644
--- a/py/compile2.c
+++ b/py/compile2.c
@@ -2248,6 +2248,10 @@ STATIC void compile_trailer_paren_helper(compiler_t *comp, const byte *p_arglist
n_keyword += 1;
}
} else {
+ if (star_flags) {
+ compile_syntax_error(comp, p, "non-keyword arg after */**");
+ return;
+ }
if (n_keyword > 0) {
compile_syntax_error(comp, p, "non-keyword arg after keyword arg");
return;