[pypy-svn] r31267 - pypy/dist/pypy/translator

arigo at codespeak.net arigo at codespeak.net
Sat Aug 12 13:39:26 CEST 2006


Author: arigo
Date: Sat Aug 12 13:39:24 2006
New Revision: 31267

Modified:
   pypy/dist/pypy/translator/geninterplevel.py
Log:
Some 2.5 compatibility.


Modified: pypy/dist/pypy/translator/geninterplevel.py
==============================================================================
--- pypy/dist/pypy/translator/geninterplevel.py	(original)
+++ pypy/dist/pypy/translator/geninterplevel.py	Sat Aug 12 13:39:24 2006
@@ -758,7 +758,7 @@
         metaclass = "space.w_type"
         name = self.uniquename('gcls_' + cls.__name__)
 
-        if issubclass(cls, Exception):
+        if issubclass(cls, py.builtin.BaseException):
             # if cls.__module__ == 'exceptions':
             # don't rely on this, py.magic redefines AssertionError
             if getattr(__builtin__,cls.__name__,None) is cls:
@@ -893,7 +893,7 @@
             if type(ret) is tuple:
                 ret = ret[0](self, ret[1], ret[2])
             return ret
-        if issubclass(cls, Exception):   # Python 2.5 only
+        if issubclass(cls, py.builtin.BaseException):   # Python 2.5 only
             # if cls.__module__ == 'exceptions':
             # don't rely on this, py.magic redefines AssertionError
             if getattr(__builtin__,cls.__name__,None) is cls:
@@ -1336,7 +1336,7 @@
                 yield "    e.normalize_exception(space)"
                 q = "if"
                 for link in block.exits[1:]:
-                    assert issubclass(link.exitcase, Exception)
+                    assert issubclass(link.exitcase, py.builtin.BaseException)
                     # Exeption classes come unwrapped in link.exitcase
                     yield "    %s space.is_true(space.issubtype(e.w_type, %s)):" % (q,
                                             self.nameof(link.exitcase))



More information about the Pypy-commit mailing list