From 1b0822743cd4dae5b2ce7b0a8447ce11fc0247b3 Mon Sep 17 00:00:00 2001 From: Laurens Van Houtven <_@lvh.cc> Date: Thu, 20 Jun 2013 22:05:08 +0200 Subject: [PATCH] Clean up find_module_py33 loader finding --- jedi/_compatibility.py | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/jedi/_compatibility.py b/jedi/_compatibility.py index 2e181e98..cccc78b4 100644 --- a/jedi/_compatibility.py +++ b/jedi/_compatibility.py @@ -16,17 +16,10 @@ 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 - loader = importlib.find_loader(string) + loader = importlib.machinery.PathFinder.find_module(string, path) + + if loader is None and path is None: # Fallback to find builtins + loader = importlib.find_loader(string) if loader is None: raise ImportError("Couldn't find a loader for {0}".format(string))