[pypy-svn] r5073 - in pypy/trunk/src/pypy/objspace: . std

arigo at codespeak.net arigo at codespeak.net
Sat Jun 12 16:21:36 CEST 2004


Author: arigo
Date: Sat Jun 12 16:21:36 2004
New Revision: 5073

Modified:
   pypy/trunk/src/pypy/objspace/std/objspace.py
   pypy/trunk/src/pypy/objspace/trivial.py
Log:
Be careful about the names found in the 'exceptions' module,
which is a regular app-level module with PyPy.


Modified: pypy/trunk/src/pypy/objspace/std/objspace.py
==============================================================================
--- pypy/trunk/src/pypy/objspace/std/objspace.py	(original)
+++ pypy/trunk/src/pypy/objspace/std/objspace.py	Sat Jun 12 16:21:36 2004
@@ -105,7 +105,9 @@
         for k in dir(exceptions):
             if k not in done:
                 v = getattr(exceptions, k)
-                if isinstance(v, str):
+                if not isinstance(v, type(Exception)):
+                    continue
+                if not issubclass(v, Exception):
                     continue
                 stack = [k]
                 while stack:

Modified: pypy/trunk/src/pypy/objspace/trivial.py
==============================================================================
--- pypy/trunk/src/pypy/objspace/trivial.py	(original)
+++ pypy/trunk/src/pypy/objspace/trivial.py	Sat Jun 12 16:21:36 2004
@@ -43,11 +43,11 @@
         # connections we have go in the inconvenient direction...
         
         for k in dir(exceptions):
-            if k.startswith('_'):
-                continue
             if k not in done:
                 v = getattr(exceptions, k)
-                if isinstance(v, str):
+                if not isinstance(v, type(Exception)):
+                    continue
+                if not issubclass(v, Exception):
                     continue
                 stack = [k]
                 while stack:



More information about the Pypy-commit mailing list