diff options
author | Pablo Galindo <Pablogsal@gmail.com> | 2019-05-31 13:09:49 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-31 13:09:49 (GMT) |
commit | 2f58a84104ef64f71deb71d264305bcd73e59c97 (patch) | |
tree | 426cce960edbd6257d909a6bde225ab935c7bb43 /Python/ast.c | |
parent | ed222a74a0ada1cb89ba0fd81f64e404ac50778d (diff) | |
download | cpython-2f58a84104ef64f71deb71d264305bcd73e59c97.zip cpython-2f58a84104ef64f71deb71d264305bcd73e59c97.tar.gz cpython-2f58a84104ef64f71deb71d264305bcd73e59c97.tar.bz2 |
bpo-37112: Allow compile to work on AST with positional only arguments with defaults (GH-13697)
Diffstat (limited to 'Python/ast.c')
-rw-r--r-- | Python/ast.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Python/ast.c b/Python/ast.c index 183b08d..b775522 100644 --- a/Python/ast.c +++ b/Python/ast.c @@ -123,7 +123,7 @@ validate_arguments(arguments_ty args) && !validate_expr(args->kwarg->annotation, Load)) { return 0; } - if (asdl_seq_LEN(args->defaults) > asdl_seq_LEN(args->args)) { + if (asdl_seq_LEN(args->defaults) > asdl_seq_LEN(args->posonlyargs) + asdl_seq_LEN(args->args)) { PyErr_SetString(PyExc_ValueError, "more positional defaults than args on arguments"); return 0; } |