Commit cb2e7e5a authored by Vadim Gorbachev (bmsdave)'s avatar Vadim Gorbachev (bmsdave) Committed by Commit Bot

Python 3 compatibility errors in third-party libraries

related CL: https://chromium-review.googlesource.com/c/v8/v8/+/1484302

Bug: chromium:935197
Change-Id: Iaabd72f3d11f4966b97c548e8f9b1bf222e9956e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1492335
Commit-Queue: Nico Weber <thakis@chromium.org>
Reviewed-by: default avatarNico Weber <thakis@chromium.org>
Reviewed-by: default avatarSergiy Belozorov <sergiyb@chromium.org>
Reviewed-by: default avatarJohannes Henkel <johannes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#637780}
parent 0af44f1c
...@@ -904,6 +904,7 @@ U. Artie Eoff <ullysses.a.eoff@intel.com> ...@@ -904,6 +904,7 @@ U. Artie Eoff <ullysses.a.eoff@intel.com>
Umar Hansa <umar.hansa@gmail.com> Umar Hansa <umar.hansa@gmail.com>
Upendra Gowda <upendrag.gowda@gmail.com> Upendra Gowda <upendrag.gowda@gmail.com>
Uzair Jaleel <uzair.jaleel@samsung.com> Uzair Jaleel <uzair.jaleel@samsung.com>
Vadim Gorbachev <bmsdave@gmail.com>
Vaibhav Agrawal <vaibhav1.a@samsung.com> Vaibhav Agrawal <vaibhav1.a@samsung.com>
Valentin Ilie <valentin.ilie@intel.com> Valentin Ilie <valentin.ilie@intel.com>
Vamshikrishna Yellenki <vamshi@motorola.com> Vamshikrishna Yellenki <vamshi@motorola.com>
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
TODO(mithro): Replace with generic download_and_extract tool. TODO(mithro): Replace with generic download_and_extract tool.
""" """
from __future__ import print_function
import argparse import argparse
import os import os
import platform import platform
...@@ -48,7 +49,7 @@ def FetchAndExtract(arch): ...@@ -48,7 +49,7 @@ def FetchAndExtract(arch):
sha1file = tarball + '.sha1' sha1file = tarball + '.sha1'
if not os.path.exists(sha1file): if not os.path.exists(sha1file):
print "WARNING: No binutils found for your architecture (%s)!" % arch print("WARNING: No binutils found for your architecture (%s)!" % arch)
return 0 return 0
checksum = ReadFile(sha1file) checksum = ReadFile(sha1file)
...@@ -62,7 +63,7 @@ def FetchAndExtract(arch): ...@@ -62,7 +63,7 @@ def FetchAndExtract(arch):
else: else:
os.unlink(stampfile) os.unlink(stampfile)
print "Downloading", tarball print("Downloading", tarball)
subprocess.check_call([ subprocess.check_call([
'download_from_google_storage', 'download_from_google_storage',
'--no_resume', '--no_resume',
...@@ -77,7 +78,7 @@ def FetchAndExtract(arch): ...@@ -77,7 +78,7 @@ def FetchAndExtract(arch):
os.makedirs(outdir) os.makedirs(outdir)
assert os.path.exists(outdir) assert os.path.exists(outdir)
print "Extracting", tarball print("Extracting", tarball)
subprocess.check_call(['tar', 'axf', tarball], cwd=outdir) subprocess.check_call(['tar', 'axf', tarball], cwd=outdir)
for tool in BINUTILS_TOOLS: for tool in BINUTILS_TOOLS:
...@@ -111,7 +112,7 @@ def main(args): ...@@ -111,7 +112,7 @@ def main(args):
# Fetch the x64 toolchain as well for official bots with 64-bit kernels. # Fetch the x64 toolchain as well for official bots with 64-bit kernels.
return FetchAndExtract('x64') return FetchAndExtract('x64')
print "Host architecture %s is not supported." % arch print("Host architecture %s is not supported." % arch)
return 1 return 1
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
# Use of this source code is governed by a BSD-style license that can be # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. # found in the LICENSE file.
from __future__ import print_function
import argparse import argparse
import sys import sys
import os import os
...@@ -125,7 +126,7 @@ def main(argv): ...@@ -125,7 +126,7 @@ def main(argv):
CheckRepoIsNotAtMasterBranch(downstream) CheckRepoIsNotAtMasterBranch(downstream)
src_dir = upstream src_dir = upstream
dest_dir = os.path.join(downstream, 'third_party/inspector_protocol') dest_dir = os.path.join(downstream, 'third_party/inspector_protocol')
print 'Rolling %s into %s ...' % (src_dir, dest_dir) print('Rolling %s into %s ...' % (src_dir, dest_dir))
src_files = set(FindFilesToSyncIn(src_dir)) src_files = set(FindFilesToSyncIn(src_dir))
dest_files = set(FindFilesToSyncIn(dest_dir)) dest_files = set(FindFilesToSyncIn(dest_dir))
to_add = [f for f in src_files if f not in dest_files] to_add = [f for f in src_files if f not in dest_files]
...@@ -133,16 +134,16 @@ def main(argv): ...@@ -133,16 +134,16 @@ def main(argv):
to_copy = [f for f in src_files to_copy = [f for f in src_files
if (f in dest_files and not FilesAreEqual( if (f in dest_files and not FilesAreEqual(
os.path.join(src_dir, f), os.path.join(dest_dir, f)))] os.path.join(src_dir, f), os.path.join(dest_dir, f)))]
print 'To add: %s' % to_add print('To add: %s' % to_add)
print 'To delete: %s' % to_delete print('To delete: %s' % to_delete)
print 'To copy: %s' % to_copy print('To copy: %s' % to_copy)
if not to_add and not to_delete and not to_copy: if not to_add and not to_delete and not to_copy:
print 'Nothing to do. You\'re good.' print('Nothing to do. You\'re good.')
sys.exit(0) sys.exit(0)
if not args.force: if not args.force:
print 'Rerun with --force if you wish the modifications to be done.' print('Rerun with --force if you wish the modifications to be done.')
sys.exit(1) sys.exit(1)
print 'You said --force ... as you wish, modifying the destination.' print('You said --force ... as you wish, modifying the destination.')
for f in to_add + to_copy: for f in to_add + to_copy:
shutil.copyfile(os.path.join(src_dir, f), os.path.join(dest_dir, f)) shutil.copyfile(os.path.join(src_dir, f), os.path.join(dest_dir, f))
shutil.copymode(os.path.join(src_dir, f), os.path.join(dest_dir, f)) shutil.copymode(os.path.join(src_dir, f), os.path.join(dest_dir, f))
......
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