[pypy-svn] pypy default: Backed out changeset 8baddb1318ac

alex_gaynor commits-noreply at bitbucket.org
Mon Jan 3 20:05:37 CET 2011


Author: Alex Gaynor <alex.gaynor at gmail.com>
Branch: 
Changeset: r40347:17cd1ea472f3
Date: 2011-01-03 13:02 -0600
http://bitbucket.org/pypy/pypy/changeset/17cd1ea472f3/

Log:	Backed out changeset 8baddb1318ac

diff --git a/pypy/interpreter/mixedmodule.py b/pypy/interpreter/mixedmodule.py
--- a/pypy/interpreter/mixedmodule.py
+++ b/pypy/interpreter/mixedmodule.py
@@ -31,13 +31,11 @@
         space.builtin_modules"""
         Module.install(self)
         if hasattr(self, "submodules"):
-            space = self.space
-            name = space.unwrap(self.w_name)
+            name = self.space.unwrap(self.w_name)
             for sub_name, module_cls in self.submodules.iteritems():
-                module_name = space.wrap("%s.%s" % (name, sub_name))
-                m = module_cls(space, module_name)
+                module_name = self.space.wrap("%s.%s" % (name, sub_name))
+                m = module_cls(self.space, module_name)
                 m.install()
-                space.setitem(self.w_dict, space.wrap(sub_name), space.wrap(m))
 
     def init(self, space):
         """This is called each time the module is imported or reloaded

diff --git a/pypy/interpreter/test/test_mixedmodule.py b/pypy/interpreter/test/test_mixedmodule.py
--- a/pypy/interpreter/test/test_mixedmodule.py
+++ b/pypy/interpreter/test/test_mixedmodule.py
@@ -29,29 +29,3 @@
 
         assert self.space.builtin_modules["test_module"] is m
         assert isinstance(self.space.builtin_modules["test_module.sub"], SubModule)
-
-class AppTestMixedModule(object):
-    def setup_class(cls):
-        space = cls.space
-
-        class SubModule(MixedModule):
-            interpleveldefs = {}
-            appleveldefs = {}
-
-        class Module(MixedModule):
-            interpleveldefs = {}
-            appleveldefs = {}
-            submodules = {
-                "sub": SubModule
-            }
-
-        m = Module(space, space.wrap("test_module"))
-        m.install()
-
-    def test_attibute(self):
-        import test_module
-
-        assert hasattr(test_module, "sub")
-
-    def test_submodule_import(self):
-        from test_module import sub


More information about the Pypy-commit mailing list