mirror of
https://github.com/python/cpython.git
synced 2025-07-29 14:15:07 +00:00
don't let a tuple msg be interpreted as arguments to AssertionError (closes #13268)
This commit is contained in:
parent
78fc70503e
commit
0c0d756098
2 changed files with 4 additions and 4 deletions
|
@ -2079,11 +2079,9 @@ compiler_assert(struct compiler *c, stmt_ty s)
|
|||
ADDOP_O(c, LOAD_GLOBAL, assertion_error, names);
|
||||
if (s->v.Assert.msg) {
|
||||
VISIT(c, expr, s->v.Assert.msg);
|
||||
ADDOP_I(c, RAISE_VARARGS, 2);
|
||||
}
|
||||
else {
|
||||
ADDOP_I(c, RAISE_VARARGS, 1);
|
||||
ADDOP_I(c, CALL_FUNCTION, 1);
|
||||
}
|
||||
ADDOP_I(c, RAISE_VARARGS, 1);
|
||||
compiler_use_next_block(c, end);
|
||||
return 1;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue