Author: Armin Rigo <[email protected]>
Branch:
Changeset: r62569:d49d2c9928f0
Date: 2013-03-20 13:32 -0700
http://bitbucket.org/pypy/pypy/changeset/d49d2c9928f0/
Log: Inline this artificial method again, now that the flow objspace no
longer subclasses this class anyway.
diff --git a/pypy/interpreter/baseobjspace.py b/pypy/interpreter/baseobjspace.py
--- a/pypy/interpreter/baseobjspace.py
+++ b/pypy/interpreter/baseobjspace.py
@@ -755,18 +755,6 @@
return obj
interp_w._annspecialcase_ = 'specialize:arg(1)'
- def _check_constant_interp_w_or_w_None(self, RequiredClass, w_obj):
- """
- This method should NOT be called unless you are really sure about
- it. It is used inside the implementation of end_finally() in
- pyopcode.py, and it's there so that it can be overridden by the
- FlowObjSpace.
- """
- if self.is_w(w_obj, self.w_None):
- return True
- obj = self.interpclass_w(w_obj)
- return isinstance(obj, RequiredClass)
-
def unpackiterable(self, w_iterable, expected_length=-1):
"""Unpack an iterable into a real (interpreter-level) list.
diff --git a/pypy/interpreter/pyopcode.py b/pypy/interpreter/pyopcode.py
--- a/pypy/interpreter/pyopcode.py
+++ b/pypy/interpreter/pyopcode.py
@@ -604,11 +604,12 @@
# item (unlike CPython which can have 1, 2 or 3 items):
# [wrapped subclass of SuspendedUnroller]
w_top = self.popvalue()
- # the following logic is a mess for the flow objspace,
- # so we hide it specially in the space :-/
- if self.space._check_constant_interp_w_or_w_None(SuspendedUnroller,
w_top):
- # case of a finally: block
- unroller = self.space.interpclass_w(w_top)
+ if self.space.is_w(w_top, self.space.w_None):
+ # case of a finally: block with no exception
+ return None
+ unroller = self.space.interpclass_w(w_top)
+ if isinstance(unroller, SuspendedUnroller):
+ # case of a finally: block with a suspended unroller
return unroller
else:
# case of an except: block. We popped the exception type
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit