[pypy-commit] pypy py3k: we need to explicitly save exceptions now

antocuni noreply at buildbot.pypy.org
Thu May 31 17:11:13 CEST 2012


Author: Antonio Cuni <anto.cuni at gmail.com>
Branch: py3k
Changeset: r55241:2485b1f27e71
Date: 2012-05-31 16:47 +0200
http://bitbucket.org/pypy/pypy/changeset/2485b1f27e71/

Log:	we need to explicitly save exceptions now

diff --git a/pypy/module/sys/test/test_sysmodule.py b/pypy/module/sys/test/test_sysmodule.py
--- a/pypy/module/sys/test/test_sysmodule.py
+++ b/pypy/module/sys/test/test_sysmodule.py
@@ -62,14 +62,16 @@
     def test_dynamic_attributes(self):
         try:
             raise Exception
-        except Exception as e:
+        except Exception as exc:
+            e = exc
             import sys
             exc_type = sys.exc_type
             exc_val = sys.exc_value
             tb = sys.exc_traceback
         try:
-            raise Exception   # 7 lines below the previous one
-        except Exception as e2:
+            raise Exception   # 8 lines below the previous one
+        except Exception as exc:
+            e2 = exc
             exc_type2 = sys.exc_type
             exc_val2 = sys.exc_value
             tb2 = sys.exc_traceback
@@ -77,7 +79,7 @@
         assert exc_val ==e
         assert exc_type2 ==Exception
         assert exc_val2 ==e2
-        assert tb2.tb_lineno - tb.tb_lineno == 7
+        assert tb2.tb_lineno - tb.tb_lineno == 8
 
     def test_exc_info_normalization(self):
         import sys


More information about the pypy-commit mailing list