From 39487196c87e28128ea907a0d9b8a88ba53f68d5 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Tue, 4 Sep 2018 11:01:09 +0200 Subject: 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. --- Lib/distutils/spawn.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Lib/distutils/spawn.py') diff --git a/Lib/distutils/spawn.py b/Lib/distutils/spawn.py index 5dd415a283..5387688093 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) -- cgit v1.2.1