import subprocess
try:
opt_cmd = subprocess.Popen([os.path.join(llvm_tools_dir, 'opt'), '-version'],
- stdout = subprocess.PIPE)
-except OSError, why:
- print "Could not find opt in " + llvm_tools_dir
+ stdout = subprocess.PIPE,
+ env=config.environment)
+except OSError:
+ print("Could not find opt in " + llvm_tools_dir)
exit(42)
-if re.search(r'with assertions', opt_cmd.stdout.read()):
+if re.search(r'with assertions', opt_cmd.stdout.read().decode('ascii')):
config.available_features.add('asserts')
opt_cmd.wait()
llvm_config_cmd = subprocess.Popen([os.path.join(llvm_tools_dir,
'llvm-config'),
'--targets-built'],
- stdout = subprocess.PIPE)
-except OSError, why:
- print "Could not find llvm-config in " + llvm_tools_dir
+ stdout = subprocess.PIPE,
+ env=config.environment)
+except OSError:
+ print("Could not find llvm-config in " + llvm_tools_dir)
exit(42)
-if re.search(r'NVPTX', llvm_config_cmd.stdout.read()):
+if re.search(r'NVPTX', llvm_config_cmd.stdout.read().decode('ascii')):
config.available_features.add('nvptx-registered-target')
llvm_config_cmd.wait()
try:
config.llvm_tools_dir = config.llvm_tools_dir % lit_config.params
config.llvm_libs_dir = config.llvm_libs_dir % lit_config.params
-except KeyError,e:
+except KeyError:
+ e = sys.exc_info()[1]
key, = e.args
lit_config.fatal("unable to find %r parameter, use '--param=%s=VALUE'" % (key,key))