1
0
forked from VimPlug/jedi

Fix Python 2 old-school relative imports

This commit is contained in:
Dave Halter
2018-02-16 20:53:31 +01:00
parent 5453566352
commit 81a30d61d6

View File

@@ -265,6 +265,11 @@ class Importer(object):
sys_path_mod = self._evaluator.get_sys_path() \
+ sys_path.check_sys_path_modifications(self.module_context)
if self.import_path and self.file_path is not None \
and self._evaluator.environment.version_info.major == 2:
# Python2 uses an old strange way of importing relative imports.
sys_path_mod.append(force_unicode(os.path.dirname(self.file_path)))
return sys_path_mod
def follow(self):