Permalink
Browse files

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
  • Loading branch information...
Astrac committed Mar 25, 2013
1 parent 07ec134 commit 0b67a08e48ee4c1430a3557f9bbccc150547aacc
Showing with 4 additions and 2 deletions.
  1. +4 −2 jedi/_compatibility.py
View
@@ -22,9 +22,11 @@ def find_module_py33(string, path=None):
returning = (None, None, None)
importing = None
if path is not None:
- importing = importlib.find_loader(string, path)
+ importing = importlib.machinery.PathFinder.find_module(string, path)
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:
raise ImportError

0 comments on commit 0b67a08

Please sign in to comment.