[pypy-commit] pypy default: merge heads - back out premature merge of nditer

mattip noreply at buildbot.pypy.org
Thu Apr 17 01:39:16 CEST 2014


Author: Matti Picus <matti.picus at gmail.com>
Branch: 
Changeset: r70678:16be85246762
Date: 2014-04-17 02:38 +0300
http://bitbucket.org/pypy/pypy/changeset/16be85246762/

Log:	merge heads - back out premature merge of nditer

diff --git a/pypy/interpreter/baseobjspace.py b/pypy/interpreter/baseobjspace.py
--- a/pypy/interpreter/baseobjspace.py
+++ b/pypy/interpreter/baseobjspace.py
@@ -462,26 +462,23 @@
             raise oefmt(self.w_SystemError,
                         "getbuiltinmodule() called with non-builtin module %s",
                         name)
-        else:
-            # Add the module to sys.modules and initialize the module
-            # The order is important to avoid recursions.
-            from pypy.interpreter.module import Module
-            if isinstance(w_mod, Module):
-                if not reuse and w_mod.startup_called:
-                    # create a copy of the module.  (see issue1514)
-                    # eventlet patcher relies on this behaviour.
-                    w_mod2 = self.wrap(Module(self, w_name))
-                    self.setitem(w_modules, w_name, w_mod2)
-                    w_mod.getdict(self)  # unlazy w_initialdict
-                    self.call_method(w_mod2.getdict(self), 'update',
-                                     w_mod.w_initialdict)
-                    return w_mod2
-                #
-                w_mod.init(self)
 
-            # Add the module to sys.modules
+        # Add the module to sys.modules and initialize the module. The
+        # order is important to avoid recursions.
+        from pypy.interpreter.module import Module
+        if isinstance(w_mod, Module):
+            if not reuse and w_mod.startup_called:
+                # create a copy of the module.  (see issue1514) eventlet
+                # patcher relies on this behaviour.
+                w_mod2 = self.wrap(Module(self, w_name))
+                self.setitem(w_modules, w_name, w_mod2)
+                w_mod.getdict(self)  # unlazy w_initialdict
+                self.call_method(w_mod2.getdict(self), 'update',
+                                 w_mod.w_initialdict)
+                return w_mod2
             self.setitem(w_modules, w_name, w_mod)
-            return w_mod
+            w_mod.init(self)
+        return w_mod
 
     def get_builtinmodule_to_install(self):
         """NOT_RPYTHON"""


More information about the pypy-commit mailing list