[pypy-commit] pypy py3.3: Fix Module.repr to use space.builtin_modules to determine if a module is builtin. (Fixes regression in test_shadow_extension_2.)

marky1991 pypy.commits at gmail.com
Wed Feb 24 04:06:52 EST 2016


Author: Mark Young <marky1991 at gmail.com>
Branch: py3.3
Changeset: r82470:1139cf119d2a
Date: 2016-02-13 11:46 -0500
http://bitbucket.org/pypy/pypy/changeset/1139cf119d2a/

Log:	Fix Module.repr to use space.builtin_modules to determine if a
	module is builtin. (Fixes regression in test_shadow_extension_2.)

diff --git a/pypy/interpreter/module.py b/pypy/interpreter/module.py
--- a/pypy/interpreter/module.py
+++ b/pypy/interpreter/module.py
@@ -121,12 +121,11 @@
         return space.newtuple(tup_return)
 
     def descr_module__repr__(self, space):
-        from pypy.interpreter.mixedmodule import MixedModule
         if self.w_name is not None:
             name = space.unicode_w(space.repr(self.w_name))
         else:
             name = u"'?'"
-        if isinstance(self, MixedModule):
+        if self.getname(space) in self.space.builtin_modules:
             return space.wrap(u"<module %s (built-in)>" % name)
         try:
             w___file__ = space.getattr(self, space.wrap('__file__'))


More information about the pypy-commit mailing list