[pypy-commit] pypy py3k: py3k-ify this test as well (syntax, exec and local scope, StringIO)

antocuni noreply at buildbot.pypy.org
Thu Feb 9 12:24:32 CET 2012


Author: Antonio Cuni <anto.cuni at gmail.com>
Branch: py3k
Changeset: r52271:f64d232c96c0
Date: 2012-02-09 12:19 +0100
http://bitbucket.org/pypy/pypy/changeset/f64d232c96c0/

Log:	py3k-ify this test as well (syntax, exec and local scope, StringIO)

diff --git a/pypy/interpreter/test/test_compiler.py b/pypy/interpreter/test/test_compiler.py
--- a/pypy/interpreter/test/test_compiler.py
+++ b/pypy/interpreter/test/test_compiler.py
@@ -868,15 +868,16 @@
 
     def test_dis_stopcode(self):
         source = """def _f(a):
-                print a
+                print(a)
                 return 1
             """
+        ns = {}
+        exec(source, ns)
+        code = ns['_f'].func_code
 
-        exec source
-        code = _f.func_code
-
-        import StringIO, sys, dis
-        s = StringIO.StringIO()
+        import sys, dis
+        from io import StringIO
+        s = StringIO()
         save_stdout = sys.stdout
         sys.stdout = s
         try:


More information about the pypy-commit mailing list