mirror of
https://github.com/davidhalter/jedi.git
synced 2026-10-29 02:13:19 +08:00
Clean up find_module_py33 loader finding
This commit is contained in:
1 parent
f171617766
commit
1b0822743c
1 file changed
+2
-9
@@ -16,16 +16,9 @@ is_py33 = sys.hexversion >= 0x03030000
|
||||
|
||||
|
||||
def find_module_py33(string, path=None):
|
||||
mod_info = (None, None, None)
|
||||
loader = None
|
||||
if path is not None:
|
||||
# Check for the module in the specidied path
|
||||
loader = importlib.machinery.PathFinder.find_module(string, path)
|
||||
else:
|
||||
# Check for the module in sys.path
|
||||
loader = importlib.machinery.PathFinder.find_module(string, sys.path)
|
||||
if loader is None:
|
||||
# Fallback to find builtins
|
||||
|
||||
if loader is None and path is None: # Fallback to find builtins
|
||||
loader = importlib.find_loader(string)
|
||||
|
||||
if loader is None:
|
||||
|
||||
Reference in new issue
Block a user