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

Python 3 compatibility errors in third-party libraries


These changes fix Python 3 compatibility errors in third-party libraries
I'm not sure if these problems can be fixed this way.
But! (1) In deps/inspector_protocol no file roll.py
it looks like the repository v8 it shouldn't be, either.
(2) I have not found a separate repository for binutils.


Bug: chromium:935197
Change-Id: Ied2bb83e0539aa392f8fc7c3aeef662612f37d06
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1484302Reviewed-by: 's avatarSergiy Belozorov <sergiyb@chromium.org>
Reviewed-by: 's avatarYang Guo <yangguo@chromium.org>
Commit-Queue: Sergiy Belozorov <sergiyb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60085}
parent e2bbc1cd
......@@ -28,13 +28,15 @@
"""Outputs host CPU architecture in format recognized by gyp."""
from __future__ import print_function
import platform
import re
import sys
def main():
print DoMain([])
print(DoMain([]))
return 0
def DoMain(_):
......
......@@ -9,6 +9,8 @@
TODO(mithro): Replace with generic download_and_extract tool.
"""
from __future__ import print_function
import os
import platform
import re
......@@ -43,7 +45,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)
......@@ -57,7 +59,7 @@ def FetchAndExtract(arch):
else:
os.unlink(stampfile)
print "Downloading", tarball
print("Downloading", tarball)
subprocess.check_call([
'download_from_google_storage',
'--no_resume',
......@@ -72,7 +74,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:
......
......@@ -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
......@@ -123,7 +124,7 @@ 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]
......@@ -131,16 +132,16 @@ def main(argv):
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))
......
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