Skip to content

Commit

Permalink
Bug 1559975: Fix python2/3 compat in gfx/ r=ahal
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris AtLee committed Jul 5, 2019
1 parent 85e26c4 commit 8cdff1c
Show file tree
Hide file tree
Showing 11 changed files with 18 additions and 9 deletions.
9 changes: 5 additions & 4 deletions gfx/angle/update-angle.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#! /usr/bin/env python3
from __future__ import print_function
assert __name__ == '__main__'

'''
Expand Down Expand Up @@ -84,7 +85,7 @@
# ------------------------------------------------------------------------------

def run_checked(*args, **kwargs):
print(' ', args)
print((' ', args))
sys.stdout.flush()
return subprocess.run(args, check=True, **kwargs)

Expand Down Expand Up @@ -293,7 +294,7 @@ 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'):
Expand All @@ -308,7 +309,7 @@ def fn(target_name):
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.')
Expand Down Expand Up @@ -570,7 +571,7 @@ def comment(x):
# 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)

Expand Down
5 changes: 3 additions & 2 deletions gfx/angle/vendor_from_git.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#! /usr/bin/env python3
from __future__ import print_function
assert __name__ != '__main__'

'''
Expand All @@ -16,12 +17,12 @@
# --

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)

Expand Down
2 changes: 1 addition & 1 deletion gfx/gl/GLParseRegistryXML.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
################################################################################

# includes
from __future__ import print_function
from __future__ import absolute_import, print_function
import os
import sys
import xml.etree.ElementTree
Expand Down
2 changes: 1 addition & 1 deletion gfx/harfbuzz/src/gen-indic-table.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ def print_block (block, start, end, data):
print ()
print ("#undef _")
for i in range (2):
print
print()
vv = sorted (values[i].keys ())
for v in vv:
print ("#undef %s_%s" %
Expand Down
1 change: 1 addition & 0 deletions gfx/layers/d3d11/genshaders.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import absolute_import
import argparse
import codecs
import locale
Expand Down
3 changes: 2 additions & 1 deletion gfx/skia/generate_mozbuild.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env python

from __future__ import print_function
import locale
import subprocess
from collections import defaultdict
Expand Down Expand Up @@ -428,7 +429,7 @@ def write_mozbuild(sources):

f.close()

print 'Wrote ' + filename
print('Wrote ' + filename)

def main():
platform_sources = generate_platform_sources()
Expand Down
1 change: 1 addition & 0 deletions gfx/tests/marionette/test_pref_rollout_workaround.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

from __future__ import absolute_import, print_function
import platform
from unittest import skipIf

Expand Down
1 change: 1 addition & 0 deletions gfx/thebes/gencjkcisvs.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.

from __future__ import absolute_import
import os.path
import re
import sys
Expand Down
1 change: 1 addition & 0 deletions gfx/wr/wrench/script/benchmark_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

from __future__ import print_function
import json
import os
import subprocess
Expand Down
1 change: 1 addition & 0 deletions gfx/wr/wrench/script/headless.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

from __future__ import print_function
import contextlib
import os
import subprocess
Expand Down
1 change: 1 addition & 0 deletions gfx/wr/wrench/script/reftest-debugger.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

from __future__ import print_function
import subprocess

with open('reftest.log', "w") as out:
Expand Down

0 comments on commit 8cdff1c

Please sign in to comment.