[pypy-svn] r42101 - pypy/dist/pypy/rpython

arigo at codespeak.net arigo at codespeak.net
Mon Apr 16 17:57:48 CEST 2007


Author: arigo
Date: Mon Apr 16 17:57:48 2007
New Revision: 42101

Modified:
   pypy/dist/pypy/rpython/llinterp.py
   pypy/dist/pypy/rpython/rclass.py
Log:
More Exception => py.builtin.BaseException conversions.


Modified: pypy/dist/pypy/rpython/llinterp.py
==============================================================================
--- pypy/dist/pypy/rpython/llinterp.py	(original)
+++ pypy/dist/pypy/rpython/llinterp.py	Mon Apr 16 17:57:48 2007
@@ -333,7 +333,7 @@
                 cls = e.args[0]
                 inst = e.args[1]
                 for link in block.exits[1:]:
-                    assert issubclass(link.exitcase, Exception)
+                    assert issubclass(link.exitcase, py.builtin.BaseException)
                     if self.op_direct_call(exdata.fn_exception_match,
                                            cls, link.llexitcase):
                         self.setifvar(link.last_exception, cls)
@@ -1138,7 +1138,8 @@
     result = []
     seen = {}
     def addcls(cls):
-        if type(cls) is type(Exception) and issubclass(cls, Exception):
+        if (type(cls) is type(Exception) and
+            issubclass(cls, py.builtin.BaseException)):
             if cls in seen:
                 return
             for base in cls.__bases__:   # bases first

Modified: pypy/dist/pypy/rpython/rclass.py
==============================================================================
--- pypy/dist/pypy/rpython/rclass.py	(original)
+++ pypy/dist/pypy/rpython/rclass.py	Mon Apr 16 17:57:48 2007
@@ -9,16 +9,6 @@
     try:
         result = rtyper.class_reprs[classdef]
     except KeyError:
-        #if classdef and classdef.cls is Exception:
-        #    # skip Exception as a base class and go directly to 'object'.
-        #    # the goal is to allow any class anywhere in the hierarchy
-        #    # to have Exception as a second base class.  It should be an
-        #    # empty class anyway.
-        #    if classdef.attrs:
-        #        raise TyperError("the Exception class should not "
-        #                         "have any attribute attached to it")
-        #    result = getclassrepr(rtyper, None)
-        #else:
         result = rtyper.type_system.rclass.ClassRepr(rtyper, classdef)
         rtyper.class_reprs[classdef] = result
         rtyper.add_pendingsetup(result)



More information about the Pypy-commit mailing list