diff options
| author | Michael Kruse <llvm@meinersbur.de> | 2015-07-24 20:33:22 +0000 |
|---|---|---|
| committer | Michael Kruse <llvm@meinersbur.de> | 2015-07-24 20:33:22 +0000 |
| commit | 1bbe346cef04e3d98ab4d7bab3dd84e1f4c2acd0 (patch) | |
| tree | 62d229a48cb912abe226f39a12bd144d20c81f41 | |
| parent | e896939e541762e516b009f1ea9ff90326c6bcd8 (diff) | |
| download | bcm5719-llvm-1bbe346cef04e3d98ab4d7bab3dd84e1f4c2acd0.tar.gz bcm5719-llvm-1bbe346cef04e3d98ab4d7bab3dd84e1f4c2acd0.zip | |
Make the lit configuration Python 3 compatible
by using the same techniques as LLVM's lit configuration.
llvm-svn: 243154
| -rw-r--r-- | polly/test/lit.cfg | 18 | ||||
| -rw-r--r-- | polly/test/lit.site.cfg.in | 3 |
2 files changed, 12 insertions, 9 deletions
diff --git a/polly/test/lit.cfg b/polly/test/lit.cfg index 0d7eb3b3e2b..45d774f2817 100644 --- a/polly/test/lit.cfg +++ b/polly/test/lit.cfg @@ -103,12 +103,13 @@ if config.test_exec_root is None: 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() @@ -116,11 +117,12 @@ try: 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() diff --git a/polly/test/lit.site.cfg.in b/polly/test/lit.site.cfg.in index 70887896c1b..903cc750c87 100644 --- a/polly/test/lit.site.cfg.in +++ b/polly/test/lit.site.cfg.in @@ -21,7 +21,8 @@ if (re.match(r'^x86_64*', '@TARGET_TRIPLE@') == None) : 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)) |

