Skip to content

Commit

Permalink
[3.10] pythongh-96861: Check for unset sys.executable during venv cre…
Browse files Browse the repository at this point in the history
…ation. (pythonGH-96887) (pythonGH-96918)

(cherry picked from commit 2cd70ff)

Co-authored-by: Vinay Sajip <vinay_sajip@yahoo.co.uk>

Co-authored-by: Vinay Sajip <vinay_sajip@yahoo.co.uk>
  • Loading branch information
miss-islington and vsajip authored Sep 18, 2022
1 parent a978e2f commit f4be544
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Lib/venv/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,11 @@ def create_if_needed(d):
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
Expand Down

0 comments on commit f4be544

Please sign in to comment.