diff --git a/jedi/inference/imports.py b/jedi/inference/imports.py index 2cb8c28b..c1a4953f 100644 --- a/jedi/inference/imports.py +++ b/jedi/inference/imports.py @@ -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):