mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
bpo-37112: Allow compile to work on AST with positional only arguments with defaults (GH-13697)
This commit is contained in:
parent
ed222a74a0
commit
2f58a84104
2 changed files with 23 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue