Skip to content

Commit

Permalink
Python 3 compatibility errors in third-party libraries
Browse files Browse the repository at this point in the history
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: Nico Weber <thakis@chromium.org>
Reviewed-by: Sergiy Belozorov <sergiyb@chromium.org>
Reviewed-by: Johannes Henkel <johannes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#637780}
  • Loading branch information
bmsdave authored and Commit Bot committed Mar 5, 2019
1 parent 0af44f1 commit cb2e7e5
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 11 deletions.
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -904,6 +904,7 @@ U. Artie Eoff <ullysses.a.eoff@intel.com>
Umar Hansa <umar.hansa@gmail.com>
Upendra Gowda <upendrag.gowda@gmail.com>
Uzair Jaleel <uzair.jaleel@samsung.com>
Vadim Gorbachev <bmsdave@gmail.com>
Vaibhav Agrawal <vaibhav1.a@samsung.com>
Valentin Ilie <valentin.ilie@intel.com>
Vamshikrishna Yellenki <vamshi@motorola.com>
Expand Down
9 changes: 5 additions & 4 deletions third_party/binutils/download.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
TODO(mithro): Replace with generic download_and_extract tool.
"""

from __future__ import print_function
import argparse
import os
import platform
Expand Down Expand Up @@ -48,7 +49,7 @@ def FetchAndExtract(arch):

sha1file = tarball + '.sha1'
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

checksum = ReadFile(sha1file)
Expand All @@ -62,7 +63,7 @@ def FetchAndExtract(arch):
else:
os.unlink(stampfile)

print "Downloading", tarball
print("Downloading", tarball)
subprocess.check_call([
'download_from_google_storage',
'--no_resume',
Expand All @@ -77,7 +78,7 @@ def FetchAndExtract(arch):
os.makedirs(outdir)
assert os.path.exists(outdir)

print "Extracting", tarball
print("Extracting", tarball)
subprocess.check_call(['tar', 'axf', tarball], cwd=outdir)

for tool in BINUTILS_TOOLS:
Expand Down Expand Up @@ -111,7 +112,7 @@ def main(args):
# Fetch the x64 toolchain as well for official bots with 64-bit kernels.
return FetchAndExtract('x64')

print "Host architecture %s is not supported." % arch
print("Host architecture %s is not supported." % arch)
return 1


Expand Down
15 changes: 8 additions & 7 deletions third_party/inspector_protocol/roll.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

from __future__ import print_function
import argparse
import sys
import os
Expand Down Expand Up @@ -125,24 +126,24 @@ def main(argv):
CheckRepoIsNotAtMasterBranch(downstream)
src_dir = upstream
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))
dest_files = set(FindFilesToSyncIn(dest_dir))
to_add = [f for f in src_files if f not in dest_files]
to_delete = [f for f in dest_files if f not in src_files]
to_copy = [f for f in src_files
if (f in dest_files and not FilesAreEqual(
os.path.join(src_dir, f), os.path.join(dest_dir, f)))]
print 'To add: %s' % to_add
print 'To delete: %s' % to_delete
print 'To copy: %s' % to_copy
print('To add: %s' % to_add)
print('To delete: %s' % to_delete)
print('To copy: %s' % 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)
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)
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:
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))
Expand Down

0 comments on commit cb2e7e5

Please sign in to comment.