forked from VimPlug/jedi
Move the import logic to the subprocess
This commit is contained in:
@@ -35,7 +35,7 @@ class DummyFile(object):
|
||||
del self.loader
|
||||
|
||||
|
||||
def find_module_py34(string, path=None, fullname=None):
|
||||
def find_module_py34(string, path=None, full_name=None):
|
||||
implicit_namespace_pkg = False
|
||||
spec = None
|
||||
loader = None
|
||||
@@ -47,8 +47,8 @@ def find_module_py34(string, path=None, fullname=None):
|
||||
|
||||
# We try to disambiguate implicit namespace pkgs with non implicit namespace pkgs
|
||||
if implicit_namespace_pkg:
|
||||
fullname = string if not path else fullname
|
||||
implicit_ns_info = ImplicitNSInfo(fullname, spec.submodule_search_locations._path)
|
||||
full_name = string if not path else full_name
|
||||
implicit_ns_info = ImplicitNSInfo(full_name, spec.submodule_search_locations._path)
|
||||
return None, implicit_ns_info, False
|
||||
|
||||
# we have found the tail end of the dotted path
|
||||
@@ -56,7 +56,8 @@ def find_module_py34(string, path=None, fullname=None):
|
||||
loader = spec.loader
|
||||
return find_module_py33(string, path, loader)
|
||||
|
||||
def find_module_py33(string, path=None, loader=None, fullname=None):
|
||||
|
||||
def find_module_py33(string, path=None, loader=None, full_name=None):
|
||||
loader = loader or importlib.machinery.PathFinder.find_module(string, path)
|
||||
|
||||
if loader is None and path is None: # Fallback to find builtins
|
||||
@@ -109,7 +110,7 @@ def find_module_py33(string, path=None, loader=None, fullname=None):
|
||||
return module_file, module_path, is_package
|
||||
|
||||
|
||||
def find_module_pre_py33(string, path=None, fullname=None):
|
||||
def find_module_pre_py33(string, path=None, full_name=None):
|
||||
try:
|
||||
module_file, module_path, description = imp.find_module(string, path)
|
||||
module_type = description[2]
|
||||
@@ -149,7 +150,7 @@ def find_module_pre_py33(string, path=None, fullname=None):
|
||||
|
||||
|
||||
find_module = find_module_py33 if is_py33 else find_module_pre_py33
|
||||
find_module = find_module_py34 if is_py34 else find_module
|
||||
find_module = find_module_py34 if is_py34 else find_module
|
||||
find_module.__doc__ = """
|
||||
Provides information about a module.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user