summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUri Lublin <uril@redhat.com>2015-01-18 14:43:35 +0200
committerUri Lublin <uril@redhat.com>2015-01-25 20:11:14 +0200
commitc096f37454332fa897b5a875e0c3a9fb7d09deb9 (patch)
tree0183e1135c29dc5b4d795ff3056520a2f9d17f7d
parentcd96284cf17524a3618ae542d53fa3c987e85a75 (diff)
scripts/Xspice: which: warn if executable is not found
Also handle None parameter case.
-rwxr-xr-xscripts/Xspice3
1 files changed, 3 insertions, 0 deletions
diff --git a/scripts/Xspice b/scripts/Xspice
index b8a7b78..fee2b0e 100755
--- a/scripts/Xspice
+++ b/scripts/Xspice
@@ -26,12 +26,15 @@ import signal
from subprocess import Popen, PIPE
def which(x):
+ if not x:
+ return x
if os.path.exists(x):
return x
for p in os.environ['PATH'].split(':'):
candidate = os.path.join(p, x)
if os.path.exists(candidate):
return candidate
+ print 'Warning: failed to find executable %s' % x
return None
if 'XSPICE_ENABLE_GDB' in os.environ: