mirror of
https://github.com/python/cpython.git
synced 2025-07-23 03:05:38 +00:00
bpo-34530: Fix distutils find_executable() (GH-9049)
distutils.spawn.find_executable() now falls back on os.defpath if the PATH environment variable is not set.
This commit is contained in:
parent
ec74d187f5
commit
39487196c8
3 changed files with 50 additions and 3 deletions
|
@ -173,7 +173,7 @@ def find_executable(executable, path=None):
|
|||
os.environ['PATH']. Returns the complete filename or None if not found.
|
||||
"""
|
||||
if path is None:
|
||||
path = os.environ['PATH']
|
||||
path = os.environ.get('PATH', os.defpath)
|
||||
|
||||
paths = path.split(os.pathsep)
|
||||
base, ext = os.path.splitext(executable)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue