Show More
@@ -69,6 +69,18 b' class ShimModule(types.ModuleType):' | |||
|
69 | 69 | """Don't produce __spec__ until requested""" |
|
70 | 70 | return __import__(self._mirror).__spec__ |
|
71 | 71 | |
|
72 | def __dir__(self): | |
|
73 | return dir(__import__(self._mirror)) | |
|
74 | ||
|
75 | @property | |
|
76 | def __all__(self): | |
|
77 | """Ensure __all__ is always defined""" | |
|
78 | mod = __import__(self._mirror) | |
|
79 | try: | |
|
80 | return mod.__all__ | |
|
81 | except AttributeError: | |
|
82 | return [name for name in dir(mod) if not name.startswith('_')] | |
|
83 | ||
|
72 | 84 | def __getattr__(self, key): |
|
73 | 85 | # Use the equivalent of import_item(name), see below |
|
74 | 86 | name = "%s.%s" % (self._mirror, key) |
General Comments 0
You need to be logged in to leave comments.
Login now