[pypy-commit] pypy default: Fix for a608b6d4a289.

arigo noreply at buildbot.pypy.org
Tue Jun 21 19:09:38 CEST 2011


Author: Armin Rigo <arigo at tunes.org>
Branch: 
Changeset: r45040:996958fbec67
Date: 2011-06-21 19:12 +0200
http://bitbucket.org/pypy/pypy/changeset/996958fbec67/

Log:	Fix for a608b6d4a289.

diff --git a/pypy/module/imp/importing.py b/pypy/module/imp/importing.py
--- a/pypy/module/imp/importing.py
+++ b/pypy/module/imp/importing.py
@@ -622,7 +622,13 @@
         try:
             if find_info:
                 w_mod = load_module(space, w_modulename, find_info)
-                w_mod = space.getitem(space.sys.get("modules"), w_modulename)
+                try:
+                    w_mod = space.getitem(space.sys.get("modules"),
+                                          w_modulename)
+                except OperationError, oe:
+                    if not oe.match(space, space.w_KeyError):
+                        raise
+                    raise OperationError(space.w_ImportError, w_modulename)
                 if w_parent is not None:
                     space.setattr(w_parent, space.wrap(partname), w_mod)
                 return w_mod


More information about the pypy-commit mailing list