Skip to content

Commit 5b3d39c

Browse files
authored
Merge pull request #6935 from radarhere/path
Do not raise an error if os.environ does not contain PATH
2 parents 28c89b1 + 7670736 commit 5b3d39c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

setup.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,9 @@ def _find_include_dir(self, dirname, include):
242242
return subdir
243243

244244

245-
def _cmd_exists(cmd):
245+
def _cmd_exists(cmd: str) -> bool:
246+
if "PATH" not in os.environ:
247+
return False
246248
return any(
247249
os.access(os.path.join(path, cmd), os.X_OK)
248250
for path in os.environ["PATH"].split(os.pathsep)

0 commit comments

Comments
 (0)