summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_compile.py
diff options
context:
space:
mode:
authorNeal Norwitz <nnorwitz@gmail.com>2005-10-24 00:08:10 (GMT)
committerNeal Norwitz <nnorwitz@gmail.com>2005-10-24 00:08:10 (GMT)
commit6ab080cd4017b0daa742be7b5ce1e78416922a79 (patch)
tree26f67c0da5978e85e75eb51b80cfacf87d7faea6 /Lib/test/test_compile.py
parentf8950654e3747d569144781bba5281b1551b176c (diff)
downloadcpython-6ab080cd4017b0daa742be7b5ce1e78416922a79.zip
cpython-6ab080cd4017b0daa742be7b5ce1e78416922a79.tar.gz
cpython-6ab080cd4017b0daa742be7b5ce1e78416922a79.tar.bz2
Fix problem handling EXTENDED_ARGs from SF bug # 1333982
Diffstat (limited to 'Lib/test/test_compile.py')
-rw-r--r--Lib/test/test_compile.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/Lib/test/test_compile.py b/Lib/test/test_compile.py
index c567fa4..93a2fb5 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)):