mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
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.
This commit is contained in:
parent
2f6fae6e51
commit
a8474d025c
7 changed files with 33 additions and 23 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue