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 @@ ...@@ -28,13 +28,15 @@
"""Outputs host CPU architecture in format recognized by gyp.""" """Outputs host CPU architecture in format recognized by gyp."""
from __future__ import print_function
import platform import platform
import re import re
import sys import sys
def main(): def main():
print DoMain([]) print(DoMain([]))
return 0 return 0
def DoMain(_): def DoMain(_):
......
...@@ -9,6 +9,8 @@ ...@@ -9,6 +9,8 @@
TODO(mithro): Replace with generic download_and_extract tool. TODO(mithro): Replace with generic download_and_extract tool.
""" """
from __future__ import print_function
import os import os
import platform import platform
import re import re
...@@ -43,7 +45,7 @@ def FetchAndExtract(arch): ...@@ -43,7 +45,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)
...@@ -57,7 +59,7 @@ def FetchAndExtract(arch): ...@@ -57,7 +59,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',
...@@ -72,7 +74,7 @@ def FetchAndExtract(arch): ...@@ -72,7 +74,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:
......
...@@ -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
...@@ -123,7 +124,7 @@ def main(argv): ...@@ -123,7 +124,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]
...@@ -131,16 +132,16 @@ def main(argv): ...@@ -131,16 +132,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