Skip to content

Commit

Permalink
[gn build] Use print_function in write_cmake_config.py
Browse files Browse the repository at this point in the history
No behavior change, just makes the script match the other scripts in
llvm/utils/gn/build.

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

llvm-svn: 348190
  • Loading branch information
nico committed Dec 3, 2018
1 parent 91f9c9c commit 660f9c9
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions llvm/utils/gn/build/write_cmake_config.py
Expand Up @@ -32,6 +32,8 @@
processing all values.
"""

from __future__ import print_function

import argparse
import os
import re
Expand Down Expand Up @@ -82,15 +84,15 @@ def repl(m):
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:
Expand Down

0 comments on commit 660f9c9

Please sign in to comment.