Skip to content

Commit 4ddb838

Browse files
committed
py/compile2: Raise SyntaxError if positional args are given after */**.
A port of 1e70fda
1 parent d7576c4 commit 4ddb838

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

py/compile2.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2248,6 +2248,10 @@ STATIC void compile_trailer_paren_helper(compiler_t *comp, const byte *p_arglist
22482248
n_keyword += 1;
22492249
}
22502250
} else {
2251+
if (star_flags) {
2252+
compile_syntax_error(comp, p, "non-keyword arg after */**");
2253+
return;
2254+
}
22512255
if (n_keyword > 0) {
22522256
compile_syntax_error(comp, p, "non-keyword arg after keyword arg");
22532257
return;

0 commit comments

Comments
 (0)