Show More
@@ -97,9 +97,18 b' class LazyFinder(object):' | |||||
97 | def __setattr__(self, name, value): |
|
97 | def __setattr__(self, name, value): | |
98 | return setattr(object.__getattribute__(self, "_finder"), name, value) |
|
98 | return setattr(object.__getattribute__(self, "_finder"), name, value) | |
99 |
|
99 | |||
100 |
def find_spec(self, |
|
100 | def find_spec(self, fullname, path, target=None): | |
101 | finder = object.__getattribute__(self, "_finder") |
|
101 | finder = object.__getattribute__(self, "_finder") | |
102 | spec = finder.find_spec(*args, **kwargs) |
|
102 | try: | |
|
103 | find_spec = finder.find_spec | |||
|
104 | except AttributeError: | |||
|
105 | loader = finder.find_module(fullname, path) | |||
|
106 | if loader is None: | |||
|
107 | spec = None | |||
|
108 | else: | |||
|
109 | spec = importlib.util.spec_from_loader(fullname, loader) | |||
|
110 | else: | |||
|
111 | spec = find_spec(fullname, path, target) | |||
103 |
|
112 | |||
104 | # Lazy loader requires exec_module(). |
|
113 | # Lazy loader requires exec_module(). | |
105 | if ( |
|
114 | if ( |
General Comments 0
You need to be logged in to leave comments.
Login now