From 09bc409657606a37346d82ab1e4c44a165bd3541 Mon Sep 17 00:00:00 2001 From: Jonathan Herman Date: Fri, 12 Apr 2013 11:30:27 -0400 Subject: Improved error handling in run_exps.py. --- common.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'common.py') 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): '''Search for @prog in system PATH. Print @hint if no binary is found. Die if not @optional.''' try: - prog = get_executable(prog) + full_path = get_executable(prog) except IOError: if not optional: sys.stderr.write(("Cannot find executable '%s' in PATH. This is " +\ "a part of '%s' which should be added to PATH.\n")\ % (prog, hint)) sys.exit(1) + else: + full_path = None - return prog + return full_path def get_config_option(option): '''Search for @option in installed kernel config (if present). -- cgit v1.2.2