Show More
@@ -54,7 +54,16 b' if sys.version_info[0] >= 3:' | |||
|
54 | 54 | if finder == self: |
|
55 | 55 | continue |
|
56 | 56 | |
|
57 | spec = finder.find_spec(fullname, path, target=target) | |
|
57 | # Originally the API was a `find_module` method, but it was | |
|
58 | # renamed to `find_spec` in python 3.4, with a new `target` | |
|
59 | # argument. | |
|
60 | find_spec_method = getattr(finder, 'find_spec', None) | |
|
61 | if find_spec_method: | |
|
62 | spec = find_spec_method(fullname, path, target=target) | |
|
63 | else: | |
|
64 | spec = finder.find_module(fullname) | |
|
65 | if spec is not None: | |
|
66 | spec = importlib.util.spec_from_loader(fullname, spec) | |
|
58 | 67 | if spec: |
|
59 | 68 | break |
|
60 | 69 |
General Comments 0
You need to be logged in to leave comments.
Login now