[pypy-commit] pypy default: Add a test for 42c400cba53a.

arigo noreply at buildbot.pypy.org
Fri Mar 30 09:42:05 CEST 2012


Author: Armin Rigo <arigo at tunes.org>
Branch: 
Changeset: r54092:30ba296a852d
Date: 2012-03-30 09:37 +0200
http://bitbucket.org/pypy/pypy/changeset/30ba296a852d/

Log:	Add a test for 42c400cba53a.

diff --git a/pypy/module/pypyjit/test_pypy_c/test_misc.py b/pypy/module/pypyjit/test_pypy_c/test_misc.py
--- a/pypy/module/pypyjit/test_pypy_c/test_misc.py
+++ b/pypy/module/pypyjit/test_pypy_c/test_misc.py
@@ -351,3 +351,23 @@
         # the following assertion fails if the loop was cancelled due
         # to "abort: vable escape"
         assert len(log.loops_by_id("eval")) == 1
+
+    def test_sys_exc_info(self):
+        def main():
+            i = 1
+            lst = [i]
+            while i < 1000:
+                try:
+                    return lst[i]
+                except:
+                    e = sys.exc_info()[1]    # ID: exc_info
+                    if not isinstance(e, IndexError):
+                        raise
+                i += 1
+            return 42
+
+        log = self.run(main)
+        assert log.result == 42
+        # the following assertion fails if the loop was cancelled due
+        # to "abort: vable escape"
+        assert len(log.loops_by_id("exc_info")) == 1


More information about the pypy-commit mailing list