[pypy-svn] r9284 - pypy/branch/dist-interpapp/pypy/interpreter

arigo at codespeak.net arigo at codespeak.net
Thu Feb 17 18:58:47 CET 2005


Author: arigo
Date: Thu Feb 17 18:58:46 2005
New Revision: 9284

Modified:
   pypy/branch/dist-interpapp/pypy/interpreter/pyframe.py
Log:
Remember the interp-level traceback for 
RuntimeError/MemoryError/KeyboardInterrupt.

Useful when running with PYPY_TB=1.



Modified: pypy/branch/dist-interpapp/pypy/interpreter/pyframe.py
==============================================================================
--- pypy/branch/dist-interpapp/pypy/interpreter/pyframe.py	(original)
+++ pypy/branch/dist-interpapp/pypy/interpreter/pyframe.py	Thu Feb 17 18:58:46 2005
@@ -75,14 +75,17 @@
                         # catch asynchronous exceptions and turn them
                         # into OperationErrors
                         except KeyboardInterrupt:
-                            raise OperationError(self.space.w_KeyboardInterrupt,
-                                                 self.space.w_None)
+                            import sys; tb = sys.exc_info()[2]
+                            raise OperationError, (self.space.w_KeyboardInterrupt,
+                                                   self.space.w_None), tb
                         except MemoryError:
-                            raise OperationError(self.space.w_MemoryError,
-                                                 self.space.w_None)
+                            import sys; tb = sys.exc_info()[2]
+                            raise OperationError, (self.space.w_MemoryError,
+                                                   self.space.w_None), tb
                         except RuntimeError, e:
-                            raise OperationError(self.space.w_RuntimeError,
-                                self.space.wrap("internal error: " + str(e)))
+                            import sys; tb = sys.exc_info()[2]
+                            raise OperationError, (self.space.w_RuntimeError,
+                                self.space.wrap("internal error: " + str(e))), tb
 
                     except OperationError, e:
                         pytraceback.record_application_traceback(



More information about the Pypy-commit mailing list