From: Neal Norwitz Date: Mon, 24 Oct 2005 00:08:10 +0000 (+0000) Subject: Fix problem handling EXTENDED_ARGs from SF bug # 1333982 X-Git-Tag: v2.5a0~1227 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6ab080cd4017b0daa742be7b5ce1e78416922a79;p=python Fix problem handling EXTENDED_ARGs from SF bug # 1333982 --- diff --git a/Lib/test/test_compile.py b/Lib/test/test_compile.py index c567fa432a..93a2fb588d 100644 --- a/Lib/test/test_compile.py +++ b/Lib/test/test_compile.py @@ -101,6 +101,29 @@ class TestSpecifics(unittest.TestCase): exec 'z = a' in g, d self.assertEqual(d['z'], 12) + def test_extended_arg(self): + longexpr = 'x = x or ' + '-x' * 2500 + code = ''' +def f(x): + %s + %s + %s + %s + %s + %s + %s + %s + %s + %s + # the expressions above have no effect, x == argument + while x: + x -= 1 + # EXTENDED_ARG/JUMP_ABSOLUTE here + return x +''' % ((longexpr,)*10) + exec code + self.assertEqual(f(5), 0) + def test_complex_args(self): def comp_args((a, b)):