Commit 9bfd95fb authored by Christian Biesinger's avatar Christian Biesinger Committed by Commit Bot

Make landmines.py Python 3-compatible

universal_newlines=True makes communicate() return a string
instead of bytes. This is necessary to match the type of the
return value of readlines() in clobber_if_necessary so that
we don't think the lines are different when they are
actually the same.

R=thakis@chromium.org

Bug: 941669
Change-Id: Ideb56385cdf5c3036e6858922fa3a7275e3b1be9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1744689
Auto-Submit: Christian Biesinger <cbiesinger@chromium.org>
Reviewed-by: default avatarNico Weber <thakis@chromium.org>
Commit-Queue: Christian Biesinger <cbiesinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#685317}
parent 918b1c13
...@@ -133,7 +133,8 @@ def main(): ...@@ -133,7 +133,8 @@ def main():
landmines = [] landmines = []
for s in options.landmine_scripts: for s in options.landmine_scripts:
proc = subprocess.Popen([sys.executable, s], stdout=subprocess.PIPE) proc = subprocess.Popen([sys.executable, s], stdout=subprocess.PIPE,
universal_newlines=True)
output, _ = proc.communicate() output, _ = proc.communicate()
landmines.extend([('%s\n' % l.strip()) for l in output.splitlines()]) landmines.extend([('%s\n' % l.strip()) for l in output.splitlines()])
clobber_if_necessary(landmines, options.src_dir) clobber_if_necessary(landmines, options.src_dir)
......
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