summaryrefslogtreecommitdiffstats
path: root/Lib/distutils/spawn.py
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@redhat.com>2018-09-04 09:01:09 (GMT)
committerGitHub <noreply@github.com>2018-09-04 09:01:09 (GMT)
commit39487196c87e28128ea907a0d9b8a88ba53f68d5 (patch)
treebca89e0d6cc9afd2af485019feeff34c821d9caa /Lib/distutils/spawn.py
parentec74d187f50a8a48f94eb37023300583fbd644cc (diff)
downloadcpython-39487196c87e28128ea907a0d9b8a88ba53f68d5.zip
cpython-39487196c87e28128ea907a0d9b8a88ba53f68d5.tar.gz
cpython-39487196c87e28128ea907a0d9b8a88ba53f68d5.tar.bz2
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.
Diffstat (limited to 'Lib/distutils/spawn.py')
-rw-r--r--Lib/distutils/spawn.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/distutils/spawn.py b/Lib/distutils/spawn.py
index 5dd415a..5387688 100644
--- a/Lib/distutils/spawn.py
+++ b/Lib/distutils/spawn.py
@@ -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)