Author: Armin Rigo <ar...@tunes.org>
Branch: py3.5
Changeset: r88217:17b695310d4d
Date: 2016-11-08 14:11 +0100
http://bitbucket.org/pypy/pypy/changeset/17b695310d4d/

Log:    hg merge default

diff --git a/pypy/interpreter/error.py b/pypy/interpreter/error.py
--- a/pypy/interpreter/error.py
+++ b/pypy/interpreter/error.py
@@ -670,10 +670,14 @@
         return OperationError(space.w_KeyboardInterrupt, space.w_None)
     except MemoryError:
         return OperationError(space.w_MemoryError, space.w_None)
-    except NotImplementedError:   # not on top of pypy! tests only
-        return OperationError(space.w_SystemError,
-                              space.wrap("NotImplementedError"))
     except rstackovf.StackOverflow as e:
+        # xxx twisted logic which happens to give the result that we
+        # want: when untranslated, a RuntimeError or its subclass
+        # NotImplementedError is caught here.  Then
+        # check_stack_overflow() will re-raise it directly.  We see
+        # the result as this exception propagates directly.  But when
+        # translated, an RPython-level RuntimeError is turned into
+        # an app-level RuntimeError by the next case.
         rstackovf.check_stack_overflow()
         return oefmt(space.w_RecursionError,
                      "maximum recursion depth exceeded")
diff --git a/pypy/module/gc/test/test_app_referents.py 
b/pypy/module/gc/test/test_app_referents.py
--- a/pypy/module/gc/test/test_app_referents.py
+++ b/pypy/module/gc/test/test_app_referents.py
@@ -4,13 +4,12 @@
 
 def test_interface_to_dump_rpy_heap_str(space):
     filename = str(udir.join('dump_rpy_heap.str'))
-    space.appexec([space.wrap(filename)], """(filename):
-        import gc
-        try:
-            gc.dump_rpy_heap(filename)
-        except SystemError:
-            pass
-    """)
+    try:
+        space.appexec([space.wrap(filename)], """(filename):
+            import gc
+            gc.dump_rpy_heap(filename)""")
+    except NotImplementedError:
+        pass
     assert os.path.exists(filename)
 
 def test_interface_to_dump_rpy_heap_file(space):
@@ -21,22 +20,20 @@
             f.write(b'X')
             return f""")
     assert os.path.getsize(filename) == 0   # the 'X' was not flushed yet
-    space.appexec([w_f], """(f):
-        import gc
-        try:
-            gc.dump_rpy_heap(f)
-        except SystemError:
-            pass
-    """)
+    try:
+        space.appexec([w_f], """(f):
+            import gc
+            gc.dump_rpy_heap(f)""")
+    except NotImplementedError:
+        pass
     assert os.path.getsize(filename) == 1   # the 'X' was flushed here
 
 def test_interface_to_dump_rpy_heap_fd(space):
     filename = str(udir.join('dump_rpy_heap.fd'))
     f = open(filename, 'wb')
-    space.appexec([space.wrap(f.fileno())], """(fd):
-        import gc
-        try:
-            gc.dump_rpy_heap(fd)
-        except SystemError:
-            pass
-    """)
+    try:
+        space.appexec([space.wrap(f.fileno())], """(fd):
+            import gc
+            gc.dump_rpy_heap(fd)""")
+    except NotImplementedError:
+        pass
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to