mirror of
https://github.com/davidhalter/jedi.git
synced 2026-05-11 09:08:43 +08:00
Using PathFinder rather than find_loader to correctly handle paths
Using PathFinder rather than find_loader to correctly handle from ... import ... Moved away from find_loader in favour of PathFinder also when using sys.path
This commit is contained in:
@@ -22,9 +22,11 @@ def find_module_py33(string, path=None):
|
|||||||
returning = (None, None, None)
|
returning = (None, None, None)
|
||||||
importing = None
|
importing = None
|
||||||
if path is not None:
|
if path is not None:
|
||||||
importing = importlib.find_loader(string, path)
|
importing = importlib.machinery.PathFinder.find_module(string, path)
|
||||||
else:
|
else:
|
||||||
importing = importlib.find_loader(string)
|
importing = importlib.machinery.PathFinder.find_module(string, sys.path)
|
||||||
|
if importing is None:
|
||||||
|
importing = importlib.find_loader(string)
|
||||||
|
|
||||||
if importing is None:
|
if importing is None:
|
||||||
raise ImportError
|
raise ImportError
|
||||||
|
|||||||
Reference in New Issue
Block a user