spack compiler add checks for access before listing directories.

This commit is contained in:
Todd Gamblin 2014-10-31 10:30:58 -07:00
parent f60fd330cb
commit 85a14b68b7

View file

@ -169,6 +169,10 @@ def _find_matches_in_path(cls, compiler_names, detect_version, *path):
checks = []
for directory in path:
if not (os.path.isdir(directory) and
os.access(directory, os.R_OK | os.X_OK)):
continue
files = os.listdir(directory)
for exe in files:
full_path = join_path(directory, exe)