mirror of
https://github.com/python/cpython.git
synced 2025-10-10 00:43:41 +00:00
gh-96861: Check for unset sys.executable during venv creation. (GH-96887)
This commit is contained in:
parent
0b62964b04
commit
2cd70ffb3f
1 changed files with 5 additions and 0 deletions
|
@ -128,6 +128,11 @@ class EnvBuilder:
|
|||
context.prompt = '(%s) ' % prompt
|
||||
create_if_needed(env_dir)
|
||||
executable = sys._base_executable
|
||||
if not executable: # see gh-96861
|
||||
raise ValueError('Unable to determine path to the running '
|
||||
'Python interpreter. Provide an explicit path or '
|
||||
'check that your PATH environment variable is '
|
||||
'correctly set.')
|
||||
dirname, exename = os.path.split(os.path.abspath(executable))
|
||||
context.executable = executable
|
||||
context.python_dir = dirname
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue