Commit 0afee778 authored by Christian Biesinger's avatar Christian Biesinger Committed by Commit Bot

Make cups_config_helper.py work with Python 3

Tested by running:
cups_config_helper.py --libs-for-gn /usr/local/google/home/cbiesinger/chromium/src/build/linux/debian_sid_amd64-sysroot

With python2 and python3.

Bug: 941669
Change-Id: I88bd4d13039a48b1aafa617e6856b07fdc87ce2a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1825568Reviewed-by: default avatarLei Zhang <thestig@chromium.org>
Commit-Queue: Christian Biesinger <cbiesinger@chromium.org>
Auto-Submit: Christian Biesinger <cbiesinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#699879}
parent 7bfcc8b7
......@@ -31,7 +31,7 @@ def run_cups_config(cups_config, mode):
and return those flags as a list."""
cups = subprocess.Popen([cups_config, '--cflags', '--ldflags', '--libs'],
stdout=subprocess.PIPE)
stdout=subprocess.PIPE, universal_newlines=True)
flags = cups.communicate()[0].strip()
flags_subset = []
......@@ -67,7 +67,7 @@ def main():
sysroot = sys.argv[2]
cups_config = os.path.join(sysroot, 'usr', 'bin', 'cups-config')
if not os.path.exists(cups_config):
print 'cups-config not found: %s' % cups_config
print('cups-config not found: %s' % cups_config)
return 1
else:
cups_config = 'cups-config'
......@@ -91,13 +91,13 @@ def main():
if gn_libs_output:
# Strip "-l" from beginning of libs, quote, and surround in [ ].
print '['
print('[')
for lib in flags:
if lib[:2] == "-l":
print '"%s", ' % lib[2:]
print ']'
print('"%s", ' % lib[2:])
print(']')
else:
print ' '.join(flags)
print(' '.join(flags))
return 0
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment