From f963f957e9869ab6be74c213e18433bf9a74d9c9 2015-03-29 21:22:00 From: Min RK Date: 2015-03-29 21:22:00 Subject: [PATCH] Don't find importable non-modules in shim --- diff --git a/IPython/utils/shimmodule.py b/IPython/utils/shimmodule.py index 0bc5c7d..d05879d 100644 --- a/IPython/utils/shimmodule.py +++ b/IPython/utils/shimmodule.py @@ -29,10 +29,13 @@ class ShimImporter(object): if fullname.startswith(self.src + '.'): mirror_name = self._mirror_name(fullname) try: - __import__(mirror_name) + mod = import_item(mirror_name) except ImportError: return else: + if not isinstance(mod, types.ModuleType): + # not a module + return None return self def load_module(self, fullname):