Do not raise an error if os.environ does not contain PATH

This commit is contained in:
Andrew Murray 2023-02-10 08:11:50 +11:00
parent 7e3bed6834
commit 5059e5c143

View File

@ -243,6 +243,8 @@ def _find_include_dir(self, dirname, include):
def _cmd_exists(cmd):
if "PATH" not in os.environ:
return
return any(
os.access(os.path.join(path, cmd), os.X_OK)
for path in os.environ["PATH"].split(os.pathsep)