mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
Closes #16519: Merged fix from 3.3.
This commit is contained in:
commit
70adf6f72f
1 changed files with 3 additions and 5 deletions
|
@ -484,15 +484,13 @@ def venv(known_paths):
|
||||||
executable = os.environ['__PYVENV_LAUNCHER__']
|
executable = os.environ['__PYVENV_LAUNCHER__']
|
||||||
else:
|
else:
|
||||||
executable = sys.executable
|
executable = sys.executable
|
||||||
executable_dir, executable_name = os.path.split(executable)
|
exe_dir, _ = os.path.split(os.path.abspath(executable))
|
||||||
site_prefix = os.path.dirname(executable_dir)
|
site_prefix = os.path.dirname(exe_dir)
|
||||||
sys._home = None
|
sys._home = None
|
||||||
if sys.platform == 'win32':
|
|
||||||
executable_name = os.path.splitext(executable_name)[0]
|
|
||||||
conf_basename = 'pyvenv.cfg'
|
conf_basename = 'pyvenv.cfg'
|
||||||
candidate_confs = [
|
candidate_confs = [
|
||||||
conffile for conffile in (
|
conffile for conffile in (
|
||||||
os.path.join(executable_dir, conf_basename),
|
os.path.join(exe_dir, conf_basename),
|
||||||
os.path.join(site_prefix, conf_basename)
|
os.path.join(site_prefix, conf_basename)
|
||||||
)
|
)
|
||||||
if os.path.isfile(conffile)
|
if os.path.isfile(conffile)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue