1
0
forked from VimPlug/jedi

* reflect default Popen behavior by inheriting os.environ

* without passing env_vars to create_environment, GeneralizedPopen behavior is same as before fix to issue #1540 (803c3cb271)
* env_vars allows explicit environment variables, per PR #1619 (f9183bbf64)
This commit is contained in:
Ryan Clary
2020-07-15 08:30:24 -07:00
parent 9957374508
commit b0f664ec94
2 changed files with 5 additions and 14 deletions
+3 -3
View File
@@ -61,7 +61,7 @@ class Environment(_BaseEnvironment):
"""
_subprocess = None
def __init__(self, executable, env_vars={}):
def __init__(self, executable, env_vars=None):
self._start_executable = executable
self._env_vars = env_vars
# Initialize the environment
@@ -136,7 +136,7 @@ class _SameEnvironmentMixin(object):
self._start_executable = self.executable = sys.executable
self.path = sys.prefix
self.version_info = _VersionInfo(*sys.version_info[:3])
self._env_vars = {}
self._env_vars = None
class SameEnvironment(_SameEnvironmentMixin, Environment):
@@ -379,7 +379,7 @@ def create_environment(path, safe=True, **kwargs):
return _create_environment(path, safe, **kwargs)
def _create_environment(path, safe=True, env_vars={}):
def _create_environment(path, safe=True, env_vars=None):
if os.path.isfile(path):
_assert_safe(path, safe)
return Environment(path, env_vars=env_vars)