[pypy-commit] pypy numpy-back-to-applevel: Don't use __import__ with lots of arguments, it can results in double imports and other silly stuff.

alex_gaynor noreply at buildbot.pypy.org
Fri Jan 27 20:16:55 CET 2012


Author: Alex Gaynor <alex.gaynor at gmail.com>
Branch: numpy-back-to-applevel
Changeset: r51862:6deca798be13
Date: 2012-01-27 13:53 -0500
http://bitbucket.org/pypy/pypy/changeset/6deca798be13/

Log:	Don't use __import__ with lots of arguments, it can results in
	double imports and other silly stuff.

diff --git a/pypy/module/micronumpy/appbridge.py b/pypy/module/micronumpy/appbridge.py
--- a/pypy/module/micronumpy/appbridge.py
+++ b/pypy/module/micronumpy/appbridge.py
@@ -11,8 +11,9 @@
     def __init__(self, space):
         self.w_import = space.appexec([], """():
         def f():
-           mod = __import__('numpypy.core._methods', {}, {}, [''])
-           return mod
+            import sys
+            __import__('numpypy.core._methods')
+            return sys.modules['numpypy.core._methods']
         return f
         """)
     


More information about the pypy-commit mailing list