[pypy-svn] r38581 - pypy/dist/pypy/objspace/std

arigo at codespeak.net arigo at codespeak.net
Mon Feb 12 17:03:27 CET 2007


Author: arigo
Date: Mon Feb 12 17:03:26 2007
New Revision: 38581

Modified:
   pypy/dist/pypy/objspace/std/typeobject.py
Log:
Continue the "hack more at __module__" story.


Modified: pypy/dist/pypy/objspace/std/typeobject.py
==============================================================================
--- pypy/dist/pypy/objspace/std/typeobject.py	(original)
+++ pypy/dist/pypy/objspace/std/typeobject.py	Mon Feb 12 17:03:26 2007
@@ -395,13 +395,12 @@
             return w_self.dict_w['__module__']
         else:
             # for non-heap types, CPython checks for a module.name in the
-            # type name.  we skip that here and only provide the default
-            if not we_are_translated():
-                # hack for faked types
-                if ('__module__' in w_self.dict_w and
-                    space.is_true(space.isinstance(w_self.dict_w['__module__'],
-                                                   space.w_str))):
-                    return w_self.dict_w['__module__']
+            # type name.  That's a hack, so we're allowed to use a different
+            # hack...
+            if ('__module__' in w_self.dict_w and
+                space.is_true(space.isinstance(w_self.dict_w['__module__'],
+                                               space.w_str))):
+                return w_self.dict_w['__module__']
             return space.wrap('__builtin__')
 
     def add_subclass(w_self, w_subclass):



More information about the Pypy-commit mailing list