[lit] Python 3.

llvm-svn: 204773
This commit is contained in:
Michael J. Spencer 2014-03-26 00:53:48 +00:00
parent ad386648b8
commit a4f983e258
3 changed files with 6 additions and 5 deletions

View File

@ -17,7 +17,7 @@ try:
config.llvm_tools_dir = config.llvm_tools_dir % lit_config.params
config.llvm_libs_dir = config.llvm_libs_dir % lit_config.params
config.llvm_build_mode = config.llvm_build_mode % lit_config.params
except KeyError,e:
except KeyError as e:
key, = e.args
lit_config.fatal("unable to find %r parameter, use '--param=%s=VALUE'" % (key,key))

View File

@ -4,6 +4,7 @@ import os
import platform
import re
import subprocess
import locale
import lit.formats
import lit.util
@ -131,11 +132,11 @@ try:
subprocess.Popen([os.path.join(llvm_tools_dir, 'llvm-config'),
'--build-mode', '--assertion-mode'],
stdout = subprocess.PIPE)
except OSError, why:
print "Could not find llvm-config in " + llvm_tools_dir
except OSError as why:
print("Could not find llvm-config in " + llvm_tools_dir)
exit(42)
llvm_config_output = llvm_config_cmd.stdout.read()
llvm_config_output = llvm_config_cmd.stdout.read().decode(locale.getdefaultlocale()[1])
llvm_config_output_list = llvm_config_output.split("\n")
if re.search(r'DEBUG', llvm_config_output_list[0]):

View File

@ -14,7 +14,7 @@ config.python_executable = "@PYTHON_EXECUTABLE@"
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 as e:
key, = e.args
lit_config.fatal("unable to find %r parameter, use '--param=%s=VALUE'" % (key,key))