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:
Victor Stinner 2018-09-04 11:01:09 +02:00 committed by GitHub
parent ec74d187f5
commit 39487196c8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 50 additions and 3 deletions

View file

@ -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)