[pypy-commit] pypy translation-cleanup: Don't use RaiseWithExplicitTraceback in flow space

rlamy noreply at buildbot.pypy.org
Sun Sep 23 18:19:33 CEST 2012


Author: Ronan Lamy <ronan.lamy at gmail.com>
Branch: translation-cleanup
Changeset: r57482:c8824970df80
Date: 2012-09-23 02:16 +0100
http://bitbucket.org/pypy/pypy/changeset/c8824970df80/

Log:	Don't use RaiseWithExplicitTraceback in flow space

diff --git a/pypy/objspace/flow/flowcontext.py b/pypy/objspace/flow/flowcontext.py
--- a/pypy/objspace/flow/flowcontext.py
+++ b/pypy/objspace/flow/flowcontext.py
@@ -2,14 +2,12 @@
 import sys
 from pypy.tool.error import source_lines
 from pypy.interpreter.error import OperationError
-from pypy.interpreter.pytraceback import PyTraceback
 from pypy.interpreter import pyframe
 from pypy.interpreter.nestedscope import Cell
 from pypy.interpreter.pycode import CO_OPTIMIZED, CO_NEWLOCALS
 from pypy.interpreter.argument import ArgumentsForTranslation
 from pypy.interpreter.pyopcode import (Return, Yield, SuspendedUnroller,
-        SReturnValue, SApplicationException, BytecodeCorruption,
-        RaiseWithExplicitTraceback)
+        SReturnValue, SApplicationException, BytecodeCorruption)
 from pypy.objspace.flow.model import *
 from pypy.objspace.flow.framestate import (FrameState, recursively_unflatten,
         recursively_flatten)
@@ -459,8 +457,6 @@
                     next_instr = res
         except FSException, operr:
             next_instr = self.handle_operation_error(operr)
-        except RaiseWithExplicitTraceback, e:
-            next_instr = self.handle_operation_error(e.operr)
         return next_instr
 
     def handle_operation_error(self, operr):
@@ -481,7 +477,7 @@
                     # re-raising an implicit operation makes it an explicit one
                     operr = FSException(operr.w_type, operr.w_value)
                 self.last_exception = operr
-                raise RaiseWithExplicitTraceback(operr)
+                raise operr
             else:
                 raise FSException(space.w_TypeError,
                     space.wrap("raise: no active exception to re-raise"))
@@ -603,6 +599,9 @@
 
 class SFlowException(SApplicationException):
     """Flowspace override for SApplicationException"""
+    def nomoreblocks(self):
+        raise self.operr
+
     def state_unpack_variables(self, space):
         return [self.operr.w_type, self.operr.w_value]
 


More information about the pypy-commit mailing list