[polly] r243154 - Make the lit configuration Python 3 compatible

Michael Kruse llvm at meinersbur.de
Fri Jul 24 13:33:23 PDT 2015


Author: meinersbur
Date: Fri Jul 24 15:33:22 2015
New Revision: 243154

URL: http://llvm.org/viewvc/llvm-project?rev=243154&view=rev
Log:
Make the lit configuration Python 3 compatible

by using the same techniques as LLVM's lit configuration.


Modified:
    polly/trunk/test/lit.cfg
    polly/trunk/test/lit.site.cfg.in

Modified: polly/trunk/test/lit.cfg
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/lit.cfg?rev=243154&r1=243153&r2=243154&view=diff
==============================================================================
--- polly/trunk/test/lit.cfg (original)
+++ polly/trunk/test/lit.cfg Fri Jul 24 15:33:22 2015
@@ -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()

Modified: polly/trunk/test/lit.site.cfg.in
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/lit.site.cfg.in?rev=243154&r1=243153&r2=243154&view=diff
==============================================================================
--- polly/trunk/test/lit.site.cfg.in (original)
+++ polly/trunk/test/lit.site.cfg.in Fri Jul 24 15:33:22 2015
@@ -21,7 +21,8 @@ if (re.match(r'^x86_64*', '@TARGET_TRIPL
 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))
 





More information about the llvm-commits mailing list