Catch the Python exception when subprocess.Popen is failing.
[oota-llvm.git] / test / lit.cfg
index c58935956a4f99f9624efaf868aaeb741e502184..d74bc7bcb58f3e4c9bf411340775b794cca26286 100644 (file)
@@ -236,8 +236,13 @@ if loadable_module:
 
 # llc knows whether he is compiled with -DNDEBUG.
 import subprocess
-llc_cmd = subprocess.Popen([os.path.join(llvm_tools_dir, 'llc'), '-version'],
+try:
+    llc_cmd = subprocess.Popen([os.path.join(llvm_tools_dir, 'llc'), '-version'],
                            stdout = subprocess.PIPE)
+except OSError, why:
+    print "Could not find llc in " + llvm_tools_dir
+    exit(42)
+
 if re.search(r'with assertions', llc_cmd.stdout.read()):
     config.available_features.add('asserts')
 llc_cmd.wait()