Some more sys path corrections.

The sys path should be defined more or less in the beginning and not be different for all modules
This commit is contained in:
Dave Halter
2018-02-16 14:39:01 +01:00
parent 6a11b7d89e
commit 039e7ba07b
4 changed files with 8 additions and 14 deletions

View File

@@ -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):

View File

@@ -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