diff options
author | Benjamin Peterson <benjamin@python.org> | 2011-10-27 08:21:59 -0400 |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2011-10-27 08:21:59 -0400 |
commit | 0c0d7560987a4a9c7290f44f4a22806d9d04a4d5 (patch) | |
tree | 6253815c1621056eb7a426ba2d1f1c81f71fa82b /Python/compile.c | |
parent | 78fc70503ee0b91276f4e2f270c8ef16669cca44 (diff) | |
download | cpython-git-0c0d7560987a4a9c7290f44f4a22806d9d04a4d5.tar.gz |
don't let a tuple msg be interpreted as arguments to AssertionError (closes #13268)
Diffstat (limited to 'Python/compile.c')
-rw-r--r-- | Python/compile.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/Python/compile.c b/Python/compile.c index 9440cec0ba..119c60f9b2 100644 --- a/Python/compile.c +++ b/Python/compile.c @@ -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; } |