Author: Philip Jenvey <[email protected]>
Branch: py3k
Changeset: r62917:67096a23ed90
Date: 2013-04-01 16:38 -0700
http://bitbucket.org/pypy/pypy/changeset/67096a23ed90/

Log:    workaround fake.checkmodule-only translation failures with a stupid
        hack -- April Fools!, not

diff --git a/pypy/interpreter/error.py b/pypy/interpreter/error.py
--- a/pypy/interpreter/error.py
+++ b/pypy/interpreter/error.py
@@ -39,7 +39,12 @@
         from pypy.objspace.std.typeobject import W_TypeObject
         self.w_type = w_type
         self._w_value = w_value
-        if isinstance(w_type, W_TypeObject):
+        # HACK: isinstance(w_type, W_TypeObject) won't translate under
+        # the fake objspace, but w_type.__class__ is W_TypeObject does
+        # and short circuits to a False constant there, causing the
+        # isinstance to be ignored =[
+        if (w_type is not None and w_type.__class__ is W_TypeObject and
+            isinstance(w_type, W_TypeObject)):
             self.setup_context(w_type.space)
         if not we_are_translated():
             self.debug_excs = []
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to