[pypy-commit] pypy py3k: fix syntax, and use next() to get the next item of the generator

antocuni noreply at buildbot.pypy.org
Tue Feb 21 10:50:37 CET 2012


Author: Antonio Cuni <anto.cuni at gmail.com>
Branch: py3k
Changeset: r52702:26bb8ffd76f5
Date: 2012-02-20 23:01 +0100
http://bitbucket.org/pypy/pypy/changeset/26bb8ffd76f5/

Log:	fix syntax, and use next() to get the next item of the generator

diff --git a/pypy/interpreter/test/test_pyframe.py b/pypy/interpreter/test/test_pyframe.py
--- a/pypy/interpreter/test/test_pyframe.py
+++ b/pypy/interpreter/test/test_pyframe.py
@@ -386,6 +386,7 @@
         
 
     def test_trace_generator_finalisation(self):
+        '''
         import sys
         l = []
         got_exc = []
@@ -396,7 +397,7 @@
             return trace
 
         d = {}
-        exec """if 1:
+        exec("""if 1:
         def g():
             try:
                 yield True
@@ -406,11 +407,11 @@
         def f():
             try:
                 gen = g()
-                gen.next()
+                next(gen)
                 gen.close()
             except:
                 pass
-        """ in d
+        """, d)
         f = d['f']
 
         sys.settrace(trace)
@@ -432,6 +433,7 @@
                      (6, 'line'),
                      (6, 'return'),
                      (12, 'return')]
+        '''
 
     def test_dont_trace_on_reraise(self):
         import sys


More information about the pypy-commit mailing list