aboutsummaryrefslogtreecommitdiffstats
path: root/common.py
diff options
context:
space:
mode:
authorJonathan Herman <hermanjl@cs.unc.edu>2013-04-12 11:30:27 -0400
committerJonathan Herman <hermanjl@cs.unc.edu>2013-04-12 11:30:27 -0400
commit09bc409657606a37346d82ab1e4c44a165bd3541 (patch)
tree72c569f69f37acafdc89fde4724bde7b373ef8f9 /common.py
parent384e322f974534c1c734db144633e3c3e002b1f8 (diff)
Improved error handling in run_exps.py.
Diffstat (limited to 'common.py')
-rw-r--r--common.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/common.py b/common.py
index 4920ec8..a2c6224 100644
--- a/common.py
+++ b/common.py
@@ -26,15 +26,17 @@ def get_executable_hint(prog, hint, optional=False):
26 '''Search for @prog in system PATH. Print @hint if no binary is found. 26 '''Search for @prog in system PATH. Print @hint if no binary is found.
27 Die if not @optional.''' 27 Die if not @optional.'''
28 try: 28 try:
29 prog = get_executable(prog) 29 full_path = get_executable(prog)
30 except IOError: 30 except IOError:
31 if not optional: 31 if not optional:
32 sys.stderr.write(("Cannot find executable '%s' in PATH. This is " +\ 32 sys.stderr.write(("Cannot find executable '%s' in PATH. This is " +\
33 "a part of '%s' which should be added to PATH.\n")\ 33 "a part of '%s' which should be added to PATH.\n")\
34 % (prog, hint)) 34 % (prog, hint))
35 sys.exit(1) 35 sys.exit(1)
36 else:
37 full_path = None
36 38
37 return prog 39 return full_path
38 40
39def get_config_option(option): 41def get_config_option(option):
40 '''Search for @option in installed kernel config (if present). 42 '''Search for @option in installed kernel config (if present).