summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTodd Gamblin <tgamblin@llnl.gov>2014-10-31 10:30:58 -0700
committerTodd Gamblin <tgamblin@llnl.gov>2014-10-31 10:30:58 -0700
commit85a14b68b75ef4e024cc84ab8ebdc4e9de4a23e1 (patch)
treea42b5515ddb786ca6bc3b410f9d87d1aa9fdf004 /lib
parentf60fd330cb1a9e5bc420e3a628ae964198083e00 (diff)
downloadspack-85a14b68b75ef4e024cc84ab8ebdc4e9de4a23e1.tar.gz
spack-85a14b68b75ef4e024cc84ab8ebdc4e9de4a23e1.tar.bz2
spack-85a14b68b75ef4e024cc84ab8ebdc4e9de4a23e1.tar.xz
spack-85a14b68b75ef4e024cc84ab8ebdc4e9de4a23e1.zip
spack compiler add checks for access before listing directories.
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/compiler.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/spack/spack/compiler.py b/lib/spack/spack/compiler.py
index 35e3b898ec..8debf518c7 100644
--- a/lib/spack/spack/compiler.py
+++ b/lib/spack/spack/compiler.py
@@ -169,6 +169,10 @@ class Compiler(object):
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)