mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-11-10 19:56:47 +03:00
Merge pull request #6935 from radarhere/path
Do not raise an error if os.environ does not contain PATH
This commit is contained in:
commit
5b3d39c116
4
setup.py
4
setup.py
|
@ -242,7 +242,9 @@ def _find_include_dir(self, dirname, include):
|
||||||
return subdir
|
return subdir
|
||||||
|
|
||||||
|
|
||||||
def _cmd_exists(cmd):
|
def _cmd_exists(cmd: str) -> bool:
|
||||||
|
if "PATH" not in os.environ:
|
||||||
|
return False
|
||||||
return any(
|
return any(
|
||||||
os.access(os.path.join(path, cmd), os.X_OK)
|
os.access(os.path.join(path, cmd), os.X_OK)
|
||||||
for path in os.environ["PATH"].split(os.pathsep)
|
for path in os.environ["PATH"].split(os.pathsep)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user