From e81c241905548fdec86058993c19bdac80545a35 Mon Sep 17 00:00:00 2001 From: Dave Halter Date: Sun, 1 Dec 2019 00:45:08 +0100 Subject: [PATCH] Remove Python 2 implicit relative imports feature Python 2 is almost gone, so I don't support those old features anymore. --- jedi/inference/imports.py | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/jedi/inference/imports.py b/jedi/inference/imports.py index 8d98311b..a2474c7f 100644 --- a/jedi/inference/imports.py +++ b/jedi/inference/imports.py @@ -276,7 +276,7 @@ class Importer(object): if self._fixed_sys_path is not None: return self._fixed_sys_path - sys_path_mod = ( + return ( # For import completions we don't want to see init paths, but for # inference we want to show the user as much as possible. # See GH #1446. @@ -284,14 +284,6 @@ class Importer(object): + sys_path.check_sys_path_modifications(self._module_context) ) - if self._inference_state.environment.version_info.major == 2: - file_path = self._module_context.py__file__() - if file_path is not None: - # Python2 uses an old strange way of importing relative imports. - sys_path_mod.append(force_unicode(os.path.dirname(file_path))) - - return sys_path_mod - def follow(self): if not self.import_path or not self._infer_possible: return NO_VALUES