summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_venv.py
diff options
context:
space:
mode:
authorSteve Dower <steve.dower@microsoft.com>2019-02-04 07:19:38 (GMT)
committerGitHub <noreply@github.com>2019-02-04 07:19:38 (GMT)
commita8474d025cab794257d2fd0bea67840779b9351f (patch)
tree1e2521303b70f42bd63cf1f432513db9cfd04742 /Lib/test/test_venv.py
parent2f6fae6e510dba653391cb510a2aca8322eec03b (diff)
downloadcpython-a8474d025cab794257d2fd0bea67840779b9351f.zip
cpython-a8474d025cab794257d2fd0bea67840779b9351f.tar.gz
cpython-a8474d025cab794257d2fd0bea67840779b9351f.tar.bz2
bpo-35872 and bpo-35873: Clears __PYVENV_LAUNCHER__ variable (GH-11745)
After reading __PYVENV_LAUNCHER__ we now set sys._base_executable value for later use. Make the same changes for macOS to avoid extra platform checks.
Diffstat (limited to 'Lib/test/test_venv.py')
-rw-r--r--Lib/test/test_venv.py11
1 files changed, 2 insertions, 9 deletions
diff --git a/Lib/test/test_venv.py b/Lib/test/test_venv.py
index 6096b9d..347544a 100644
--- a/Lib/test/test_venv.py
+++ b/Lib/test/test_venv.py
@@ -52,10 +52,7 @@ class BaseTest(unittest.TestCase):
self.bindir = 'bin'
self.lib = ('lib', 'python%d.%d' % sys.version_info[:2])
self.include = 'include'
- if sys.platform == 'darwin' and '__PYVENV_LAUNCHER__' in os.environ:
- executable = os.environ['__PYVENV_LAUNCHER__']
- else:
- executable = sys.executable
+ executable = getattr(sys, '_base_executable', sys.executable)
self.exe = os.path.split(executable)[-1]
def tearDown(self):
@@ -100,11 +97,7 @@ class BasicTest(BaseTest):
else:
self.assertFalse(os.path.exists(p))
data = self.get_text_file_contents('pyvenv.cfg')
- if sys.platform == 'darwin' and ('__PYVENV_LAUNCHER__'
- in os.environ):
- executable = os.environ['__PYVENV_LAUNCHER__']
- else:
- executable = sys.executable
+ executable = getattr(sys, '_base_executable', sys.executable)
path = os.path.dirname(executable)
self.assertIn('home = %s' % path, data)
fn = self.get_env_file(self.bindir, self.exe)