From: Benjamin Peterson Date: Thu, 27 Oct 2011 12:21:59 +0000 (-0400) Subject: don't let a tuple msg be interpreted as arguments to AssertionError (closes #13268) X-Git-Tag: v2.7.3rc1~371 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0c0d7560987a4a9c7290f44f4a22806d9d04a4d5;p=thirdparty%2FPython%2Fcpython.git don't let a tuple msg be interpreted as arguments to AssertionError (closes #13268) --- diff --git a/Misc/NEWS b/Misc/NEWS index 04aa011cecb8..9f7028fef5bf 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -9,6 +9,8 @@ What's New in Python 2.7.3? Core and Builtins ----------------- +- Issue #13268: Fix the assert statement when a tuple is passed as the message. + - Issue #13018: Fix reference leaks in error paths in dictobject.c. Patch by Suman Saha. diff --git a/Python/compile.c b/Python/compile.c index 9440cec0bad0..119c60f9b23b 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; }