forked from VimPlug/jedi
chore: remove unnecessary for loop
This commit is contained in:
@@ -422,18 +422,13 @@ def import_module(inference_state, import_names, parent_module_value, sys_path):
|
||||
# The module might not be a package.
|
||||
return NO_VALUES
|
||||
|
||||
for i, path in enumerate(paths):
|
||||
if not isinstance(path, list):
|
||||
path = paths[i:]
|
||||
file_io_or_ns, is_pkg = inference_state.compiled_subprocess.get_module_info(
|
||||
string=import_names[-1],
|
||||
path=path,
|
||||
full_name=module_name,
|
||||
is_global_search=False,
|
||||
)
|
||||
if is_pkg is not None:
|
||||
break
|
||||
else:
|
||||
file_io_or_ns, is_pkg = inference_state.compiled_subprocess.get_module_info(
|
||||
string=import_names[-1],
|
||||
path=paths,
|
||||
full_name=module_name,
|
||||
is_global_search=False,
|
||||
)
|
||||
if is_pkg is None:
|
||||
return NO_VALUES
|
||||
|
||||
if isinstance(file_io_or_ns, ImplicitNSInfo):
|
||||
|
||||
Reference in New Issue
Block a user