Skip to content

Commit

Permalink
Merge pull request #6935 from radarhere/path
Browse files Browse the repository at this point in the history
Do not raise an error if os.environ does not contain PATH
  • Loading branch information
radarhere committed Mar 12, 2023
2 parents 28c89b1 + 7670736 commit 5b3d39c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,9 @@ def _find_include_dir(self, dirname, include):
return subdir


def _cmd_exists(cmd):
def _cmd_exists(cmd: str) -> bool:
if "PATH" not in os.environ:
return False
return any(
os.access(os.path.join(path, cmd), os.X_OK)
for path in os.environ["PATH"].split(os.pathsep)
Expand Down

0 comments on commit 5b3d39c

Please sign in to comment.