Bug 1562462 - Revert py-2to3 changes on py3 files from bug 1559975. NPOTB a=pascalc
authorJeff Gilbert <jgilbert@mozilla.com>
Fri, 02 Aug 2019 00:48:06 +0000
changeset 544979 1cb600dceac23344e33eb9d970ffd5a7bad8525b
parent 544978 605fe408fac1e1c8613c860118c9a0b999ddf0b4
child 544980 af67ed2165eb1b23c6dc1a9485dbd68a11985484
push id2131
push userffxbld-merge
push dateMon, 26 Aug 2019 18:30:20 +0000
treeherdermozilla-release@b19ffb3ca153 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspascalc
bugs1562462, 1559975
milestone69.0
Bug 1562462 - Revert py-2to3 changes on py3 files from bug 1559975. NPOTB a=pascalc Differential Revision: https://phabricator.services.mozilla.com/D40353
gfx/angle/update-angle.py
gfx/angle/vendor_from_git.py
--- a/gfx/angle/update-angle.py
+++ b/gfx/angle/update-angle.py
@@ -1,10 +1,9 @@
 #! /usr/bin/env python3
-from __future__ import print_function
 assert __name__ == '__main__'
 
 '''
 To update ANGLE in Gecko, use Windows with git-bash, and setup depot_tools, python2, and
 python3. Because depot_tools expects `python` to be `python2` (shame!), python2 must come
 before python3 in your path.
 
 Upstream: https://chromium.googlesource.com/angle/angle
@@ -80,17 +79,17 @@ while True:
 GN_ENV = dict(os.environ)
 GN_ENV['DEPOT_TOOLS_WIN_TOOLCHAIN'] = '0'
 
 (GIT_REMOTE, ) = args # Not always 'origin'!
 
 # ------------------------------------------------------------------------------
 
 def run_checked(*args, **kwargs):
-    print((' ', args))
+    print(' ', args)
     sys.stdout.flush()
     return subprocess.run(args, check=True, **kwargs)
 
 
 def sorted_items(x):
     for k in sorted(x.keys()):
         yield (k, x[k])
 
@@ -289,32 +288,32 @@ def has_all_includes(target_name: str, d
 
 # -
 # Gather real targets:
 
 def gather_libraries(roots: Sequence[str], descs: dict) -> Set[str]:
     libraries = set()
     def fn(target_name):
         cur = descs[target_name]
-        print(('  ' + cur['type'], target_name))
+        print('  ' + cur['type'], target_name)
         assert has_all_includes(target_name, descs), target_name
 
         if cur['type'] in ('shared_library', 'static_library'):
             libraries.add(target_name)
         return (cur['deps'], )
 
     dag_traverse(roots, fn)
     return libraries
 
 # -
 
 libraries = gather_libraries(ROOTS, descs)
 print(f'\n{len(libraries)} libraries:')
 for k in libraries:
-    print((' ', k))
+    print(' ', k)
 
 if CHECK_ONLY:
     print('\n--check complete.')
     exit(0)
 
 # ------------------------------------------------------------------------------
 # Output to moz.builds
 
@@ -566,17 +565,17 @@ def export_target(target_name) -> Set[st
     elif lib_type == 'static_library':
         lines.append(f"Library('{name}')")
     else:
         assert False, lib_type
 
     # Write it out
 
     mozbuild = target_dir / 'moz.build'
-    print((' ', ' ', f'Writing {mozbuild}'))
+    print(' ', ' ', f'Writing {mozbuild}')
     data = b'\n'.join((x.encode() for x in lines))
     mozbuild.write_bytes(data)
 
     return required_files
 
 # -
 
 for target_name in libraries:
--- a/gfx/angle/vendor_from_git.py
+++ b/gfx/angle/vendor_from_git.py
@@ -1,10 +1,9 @@
 #! /usr/bin/env python3
-from __future__ import print_function
 assert __name__ != '__main__'
 
 '''
 Any time we vendor[1] from an external git repo, we want to keep a record of the csets
 we're pulling from.
 
 This script leaves a record of the merge-base reference tip and cherry-picks that we pull
 into Gecko. (such as gfx/angle/cherry_picks.txt)
@@ -12,22 +11,22 @@ into Gecko. (such as gfx/angle/cherry_pi
 
 from pathlib import *
 import subprocess
 import sys
 
 # --
 
 def print_now(*args):
-    print((*args))
+    print(*args)
     sys.stdout.flush()
 
 
 def run_checked(*args, **kwargs):
-    print((' ', args))
+    print(' ', args)
     sys.stdout.flush()
     return subprocess.run(args, check=True, **kwargs)
 
 # --
 
 def record_cherry_picks(dir_in_gecko, merge_base_origin):
     # merge_base_origin is not always 'origin'!
     merge_base_from = Path(dir_in_gecko, 'MERGE_BASE').read_text().split('\n')[0]