From d872eef1a72132b2d09c341dac2317b218036910 Mon Sep 17 00:00:00 2001 From: Kirat Singh Date: Wed, 6 Oct 2021 13:15:20 +0000 Subject: [PATCH] chore: remove unnecessary for loop --- jedi/inference/imports.py | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) 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):