don't spew pathlib internal state if $HOME is not readable

For some reason, pathlib raises tracebacks when exists() fails due to
permission errors. This is obviously wrong, and worse, unfriendly; use
the sane os.path.exists() behavior and return "doesn't exist".
pull/9689/head
Eli Schwartz 3 years ago
parent c88bfdbefc
commit cae5e19290
No known key found for this signature in database
GPG Key ID: CEB167EFB5722BD6
  1. 7
      mesonbuild/dependencies/cmake.py

@ -349,8 +349,11 @@ class CMakeDependency(ExternalDependency):
# Check the Linux CMake registry
linux_reg = Path.home() / '.cmake' / 'packages'
for p in [linux_reg / name, linux_reg / lname]:
if p.exists():
return True
try:
if p.exists():
return True
except PermissionError:
continue
return False

Loading…
Cancel
Save