Use type hint

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
This commit is contained in:
Andrew Murray 2023-03-12 23:17:39 +11:00 committed by GitHub
parent 5059e5c143
commit 7670736e18
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -242,9 +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
return False
return any(
os.access(os.path.join(path, cmd), os.X_OK)
for path in os.environ["PATH"].split(os.pathsep)