mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Do not choke on non existing path
This commit is contained in:
parent
9a35eb712a
commit
163bab3849
1 changed files with 4 additions and 1 deletions
|
@ -207,7 +207,10 @@ def which(exe=None):
|
|||
# iterate through all extensions to see which one is executable
|
||||
for ext in pathext:
|
||||
pext = p + ext
|
||||
rp = resolve(pext)
|
||||
try:
|
||||
rp = resolve(pext)
|
||||
except OSError as exc:
|
||||
continue
|
||||
if is_executable(rp):
|
||||
return p + ext
|
||||
continue
|
||||
|
|
Loading…
Add table
Reference in a new issue