Author: marky1991
Branch: fix-3.3-pypy-magic
Changeset: r81698:afb2b3cd9535
Date: 2015-12-17 01:22 -0500
http://bitbucket.org/pypy/pypy/changeset/afb2b3cd9535/

Log:    When doing init_builtin, force a module.init() call to make sure we
        don't just grab the module out of sys.modules. (Fixes reload())

diff --git a/pypy/module/imp/interp_imp.py b/pypy/module/imp/interp_imp.py
--- a/pypy/module/imp/interp_imp.py
+++ b/pypy/module/imp/interp_imp.py
@@ -84,7 +84,9 @@
     name = space.str0_w(w_name)
     if name not in space.builtin_modules:
         return
-    return space.getbuiltinmodule(name)
+    #This is needed to make reload actually reload instead of just using the
+    #already-present module in sys.modules.
+    return space.getbuiltinmodule(name, force_init=True)
 
 def init_frozen(space, w_name):
     return None
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to