##// END OF EJS Templates
copy `__spec__` in shim module...
Min RK -
Show More
@@ -3,6 +3,7 b''
3 # Copyright (c) IPython Development Team.
3 # Copyright (c) IPython Development Team.
4 # Distributed under the terms of the Modified BSD License.
4 # Distributed under the terms of the Modified BSD License.
5
5
6 import sys
6 import types
7 import types
7
8
8 class ShimModule(types.ModuleType):
9 class ShimModule(types.ModuleType):
@@ -10,6 +11,8 b' class ShimModule(types.ModuleType):'
10 def __init__(self, *args, **kwargs):
11 def __init__(self, *args, **kwargs):
11 self._mirror = kwargs.pop("mirror")
12 self._mirror = kwargs.pop("mirror")
12 super(ShimModule, self).__init__(*args, **kwargs)
13 super(ShimModule, self).__init__(*args, **kwargs)
14 if sys.version_info >= (3,4):
15 self.__spec__ = __import__(self._mirror).__spec__
13
16
14 def __getattr__(self, key):
17 def __getattr__(self, key):
15 # Use the equivalent of import_item(name), see below
18 # Use the equivalent of import_item(name), see below
General Comments 0
You need to be logged in to leave comments. Login now