diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/spack/spack/util/executable.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/spack/spack/util/executable.py b/lib/spack/spack/util/executable.py index 3aea141d87..36c7e73e06 100644 --- a/lib/spack/spack/util/executable.py +++ b/lib/spack/spack/util/executable.py @@ -330,8 +330,11 @@ def which_string(*args, **kwargs): for candidate_item in candidate_items: for directory in search_paths: exe = directory / candidate_item - if exe.is_file() and os.access(str(exe), os.X_OK): - return str(exe) + try: + if exe.is_file() and os.access(str(exe), os.X_OK): + return str(exe) + except OSError: + pass if required: raise CommandNotFoundError("spack requires '%s'. Make sure it is in your path." % args[0]) |