[pypy-svn] r35197 - pypy/branch/jit-real-world/pypy/interpreter

arigo at codespeak.net arigo at codespeak.net
Fri Dec 1 13:12:46 CET 2006


Author: arigo
Date: Fri Dec  1 13:12:44 2006
New Revision: 35197

Modified:
   pypy/branch/jit-real-world/pypy/interpreter/pyopcode.py
Log:
(arigo, arre in parallel)

Work around bad support for "raise Class, instance" in the flow space.


Modified: pypy/branch/jit-real-world/pypy/interpreter/pyopcode.py
==============================================================================
--- pypy/branch/jit-real-world/pypy/interpreter/pyopcode.py	(original)
+++ pypy/branch/jit-real-world/pypy/interpreter/pyopcode.py	Fri Dec  1 13:12:44 2006
@@ -91,8 +91,13 @@
         block = self.unrollstack(SApplicationException.kind)
         if block is None:
             # no handler found for the OperationError
-            tb = cpython_tb()
-            raise OperationError, operr, tb
+            if we_are_translated():
+                raise operr
+            else:
+                # try to preserve the CPython-level traceback
+                import sys
+                tb = sys.exc_info()[2]
+                raise OperationError, operr, tb
         else:
             unroller = SApplicationException(operr)
             next_instr = block.handle(self, unroller)
@@ -868,13 +873,6 @@
 
 ### ____________________________________________________________ ###
 
-
-def cpython_tb():
-   """NOT_RPYTHON"""
-   import sys
-   return sys.exc_info()[2]   
-cpython_tb._annspecialcase_ = "override:ignore"
-
 class Reraise(Exception):
     """Signal an application-level OperationError that should not grow
     a new traceback entry nor trigger the trace hook."""



More information about the Pypy-commit mailing list