mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Issue #28257: Improved error message when pass a non-iterable as
a var-positional argument. Added opcode BUILD_TUPLE_UNPACK_WITH_CALL.
This commit is contained in:
parent
8f0f205649
commit
7344285c19
9 changed files with 140 additions and 113 deletions
|
@ -987,9 +987,9 @@ PyCompile_OpcodeStackEffect(int opcode, int oparg)
|
|||
return 1-oparg;
|
||||
case BUILD_LIST_UNPACK:
|
||||
case BUILD_TUPLE_UNPACK:
|
||||
case BUILD_TUPLE_UNPACK_WITH_CALL:
|
||||
case BUILD_SET_UNPACK:
|
||||
case BUILD_MAP_UNPACK:
|
||||
return 1 - oparg;
|
||||
case BUILD_MAP_UNPACK_WITH_CALL:
|
||||
return 1 - oparg;
|
||||
case BUILD_MAP:
|
||||
|
@ -3549,7 +3549,7 @@ compiler_call_helper(struct compiler *c,
|
|||
if (nsubargs > 1) {
|
||||
/* If we ended up with more than one stararg, we need
|
||||
to concatenate them into a single sequence. */
|
||||
ADDOP_I(c, BUILD_TUPLE_UNPACK, nsubargs);
|
||||
ADDOP_I(c, BUILD_TUPLE_UNPACK_WITH_CALL, nsubargs);
|
||||
}
|
||||
else if (nsubargs == 0) {
|
||||
ADDOP_I(c, BUILD_TUPLE, 0);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue