[llvm] r348190 - [gn build] Use print_function in write_cmake_config.py

Nico Weber via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 3 13:10:19 PST 2018


Author: nico
Date: Mon Dec  3 13:10:19 2018
New Revision: 348190

URL: http://llvm.org/viewvc/llvm-project?rev=348190&view=rev
Log:
[gn build] Use print_function in write_cmake_config.py

No behavior change, just makes the script match the other scripts in
llvm/utils/gn/build.

Differential Revision: https://reviews.llvm.org/D55183

Modified:
    llvm/trunk/utils/gn/build/write_cmake_config.py

Modified: llvm/trunk/utils/gn/build/write_cmake_config.py
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/gn/build/write_cmake_config.py?rev=348190&r1=348189&r2=348190&view=diff
==============================================================================
--- llvm/trunk/utils/gn/build/write_cmake_config.py (original)
+++ llvm/trunk/utils/gn/build/write_cmake_config.py Mon Dec  3 13:10:19 2018
@@ -32,6 +32,8 @@ Fails if any of the KEY=VALUE arguments
 processing all values.
 """
 
+from __future__ import print_function
+
 import argparse
 import os
 import re
@@ -82,15 +84,15 @@ def main():
         out_lines.append(in_line)
 
     if unused_values:
-        print >>sys.stderr, 'Unused --values args:'
-        print >>sys.stderr, '    ', '\n    '.join(unused_values)
+        print('unused values args:', file=sys.stderr)
+        print('    ', '\n    '.join(unused_values), file=sys.stderr)
         return 1
 
     output = ''.join(out_lines)
 
     leftovers = var_re.findall(output)
     if leftovers:
-        print >>sys.stderr, 'unprocessed values:\n', '\n'.join(leftovers)
+        print('unprocessed values:\n', '\n'.join(leftovers), file=sys.stderr)
         return 1
 
     if not os.path.exists(args.output) or open(args.output).read() != output:




More information about the llvm-commits mailing list