diff --git a/jedi/api/project.py b/jedi/api/project.py index c5f9c5d9..74643962 100644 --- a/jedi/api/project.py +++ b/jedi/api/project.py @@ -64,9 +64,8 @@ class Project(object): want. By default the ``sys.path.`` is generated from the environment (virtualenvs, etc). :param smart_sys_path: If this is enabled (default), adds paths from - Django, buildout and local directories. Otherwise you will have to - rely on your packages being properly configured on the - ``sys.path``. + local directories. Otherwise you will have to rely on your packages + being properly configured on the ``sys.path``. """ def py2_comp(path, environment=None, sys_path=None, smart_sys_path=True, _django=False): diff --git a/jedi/evaluate/imports.py b/jedi/evaluate/imports.py index ee2bce32..45005893 100644 --- a/jedi/evaluate/imports.py +++ b/jedi/evaluate/imports.py @@ -264,11 +264,6 @@ class Importer(object): def sys_path_with_modifications(self): sys_path_mod = self._evaluator.get_sys_path() \ + sys_path.check_sys_path_modifications(self.module_context) - if self.file_path is not None: - # Since we know nothing about the call location of the sys.path, - # it's a possibility that the current directory is the origin of - # the Python execution. - sys_path_mod.append(force_unicode(os.path.dirname(self.file_path))) return sys_path_mod diff --git a/test/completion/import_tree/rename2.py b/test/completion/import_tree/rename2.py index 8423895d..3d1a12ee 100644 --- a/test/completion/import_tree/rename2.py +++ b/test/completion/import_tree/rename2.py @@ -1,6 +1,6 @@ """ used for renaming tests """ -from rename1 import abc +from import_tree.rename1 import abc abc diff --git a/test/completion/usages.py b/test/completion/usages.py index be27ae51..1fdbc3fc 100644 --- a/test/completion/usages.py +++ b/test/completion/usages.py @@ -83,18 +83,18 @@ import module_not_exists module_not_exists -#< ('rename1', 1,0), (0,24), (3,0), (6,17), ('rename2', 4,5), (11,17), (14,17), ('imports', 72, 16) +#< ('rename1', 1,0), (0,24), (3,0), (6,17), ('rename2', 4,17), (11,17), (14,17), ('imports', 72, 16) from import_tree import rename1 -#< (0,8), ('rename1',3,0), ('rename2',4,20), ('rename2',6,0), (3,32), (8,32), (5,0) +#< (0,8), ('rename1',3,0), ('rename2',4,32), ('rename2',6,0), (3,32), (8,32), (5,0) rename1.abc -#< (-3,8), ('rename1', 3,0), ('rename2', 4,20), ('rename2', 6,0), (0,32), (5,32), (2,0) +#< (-3,8), ('rename1', 3,0), ('rename2', 4,32), ('rename2', 6,0), (0,32), (5,32), (2,0) from import_tree.rename1 import abc -#< (-5,8), (-2,32), ('rename1', 3,0), ('rename2', 4,20), ('rename2', 6,0), (0,0), (3,32) +#< (-5,8), (-2,32), ('rename1', 3,0), ('rename2', 4,32), ('rename2', 6,0), (0,0), (3,32) abc -#< 20 ('rename1', 1,0), ('rename2', 4,5), (-11,24), (-8,0), (-5,17), (0,17), (3,17), ('imports', 72, 16) +#< 20 ('rename1', 1,0), ('rename2', 4,17), (-11,24), (-8,0), (-5,17), (0,17), (3,17), ('imports', 72, 16) from import_tree.rename1 import abc #< (0, 32),