122 spec = importlib.util.find_spec(modulename) |
122 spec = importlib.util.find_spec(modulename) |
123 except Exception: |
123 except Exception: |
124 pass |
124 pass |
125 else: |
125 else: |
126 if spec is not None: |
126 if spec is not None: |
127 if spec.origin != "namespace": |
127 filename = spec.origin |
128 filename = spec.origin |
|
129 path = list(spec.submodule_search_locations or ()) |
128 path = list(spec.submodule_search_locations or ()) |
130 return filename, path |
129 return filename, path |
131 |
130 |
132 |
131 |
133 def add_stdlib_paths(paths): |
132 def add_stdlib_paths(paths): |