mirror of
https://github.com/davidhalter/jedi.git
synced 2026-05-18 14:29:40 +08:00
Remove Python 2 implicit relative imports feature
Python 2 is almost gone, so I don't support those old features anymore.
This commit is contained in:
@@ -276,7 +276,7 @@ class Importer(object):
|
|||||||
if self._fixed_sys_path is not None:
|
if self._fixed_sys_path is not None:
|
||||||
return self._fixed_sys_path
|
return self._fixed_sys_path
|
||||||
|
|
||||||
sys_path_mod = (
|
return (
|
||||||
# For import completions we don't want to see init paths, but for
|
# For import completions we don't want to see init paths, but for
|
||||||
# inference we want to show the user as much as possible.
|
# inference we want to show the user as much as possible.
|
||||||
# See GH #1446.
|
# See GH #1446.
|
||||||
@@ -284,14 +284,6 @@ class Importer(object):
|
|||||||
+ sys_path.check_sys_path_modifications(self._module_context)
|
+ 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):
|
def follow(self):
|
||||||
if not self.import_path or not self._infer_possible:
|
if not self.import_path or not self._infer_possible:
|
||||||
return NO_VALUES
|
return NO_VALUES
|
||||||
|
|||||||
Reference in New Issue
Block a user