[Python-checkins] python/dist/src/Lib/test test_compile.py, 1.24, 1.25

nnorwitz@users.sourceforge.net nnorwitz at users.sourceforge.net
Mon Oct 24 02:08:14 CEST 2005


Update of /cvsroot/python/python/dist/src/Lib/test
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24267/Lib/test

Modified Files:
	test_compile.py 
Log Message:
Fix problem handling EXTENDED_ARGs from SF bug # 1333982

Index: test_compile.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_compile.py,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- test_compile.py	24 Oct 2004 00:10:06 -0000	1.24
+++ test_compile.py	24 Oct 2005 00:08:10 -0000	1.25
@@ -101,6 +101,29 @@
         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)):



More information about the Python-checkins mailing list