[pypy-commit] pypy py3k: kill this test: python3 no longer supports the "raise with traceback" form: we

antocuni noreply at buildbot.pypy.org
Fri Feb 10 14:49:47 CET 2012


Author: Antonio Cuni <anto.cuni at gmail.com>
Branch: py3k
Changeset: r52350:b0752a8aa176
Date: 2012-02-10 10:48 +0100
http://bitbucket.org/pypy/pypy/changeset/b0752a8aa176/

Log:	kill this test: python3 no longer supports the "raise with
	traceback" form: we can do something similar by setting
	e.__traceback__, but then the raise is traced normally, hence this
	test will never work on python3 (and it fails on cpython)

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
@@ -453,31 +453,6 @@
         assert len(l) == 1
         assert issubclass(l[0][0], Exception)
 
-    def test_dont_trace_on_raise_with_tb(self):
-        import sys
-        l = []
-        def ltrace(a,b,c): 
-            if b == 'exception':
-                l.append(c)
-            return ltrace
-        def trace(a,b,c): return ltrace
-        def f():
-            try:
-                raise Exception
-            except:
-                return sys.exc_info()
-        def g():
-            exc, val, tb = f()
-            try:
-                raise exc, val, tb
-            except:
-                pass
-        sys.settrace(trace)
-        g()
-        sys.settrace(None)
-        assert len(l) == 1
-        assert isinstance(l[0][1], Exception)
-
     def test_trace_changes_locals(self):
         import sys
         def trace(frame, what, arg):


More information about the pypy-commit mailing list