Bug 1559975 - Make config/ lint with 'py2' and 'py3' r=catlee

Depends on D36091

Differential Revision: https://phabricator.services.mozilla.com/D36092

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Justin Wood 2019-07-08 17:30:34 +00:00
parent 7a37d64346
commit baa089903e
29 changed files with 33 additions and 4 deletions

View File

@ -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
import time
import zipfile
@ -47,7 +48,7 @@ class ZipFile(zipfile.ZipFile):
date_time=time.localtime(time.time()))
zinfo.compress_type = self.compression
# Add some standard UNIX file access permissions (-rw-r--r--).
zinfo.external_attr = (0x81a4 & 0xFFFF) << 16L
zinfo.external_attr = (0x81a4 & 0xFFFF) << 16
else:
zinfo = zinfo_or_arcname

View File

@ -9,6 +9,7 @@
# JSErrorFormatString.format member should be in ASCII encoding.
# ----------------------------------------------------------------------------
from __future__ import absolute_import
from __future__ import print_function
import os

View File

@ -7,6 +7,7 @@
# This script checks bytecode documentation in js/src/vm/Opcodes.h
# ----------------------------------------------------------------------------
from __future__ import absolute_import
from __future__ import print_function
import os

View File

@ -20,6 +20,7 @@
# proper methods annotations.
# ----------------------------------------------------------------------------
from __future__ import absolute_import
from __future__ import print_function
import difflib

View File

@ -9,6 +9,7 @@
# not, an error message is printed, quoting ERROR_LOCATION, which should
# probably be the filename and line number of the erroneous call to
# check_source_count.py.
from __future__ import absolute_import
from __future__ import print_function
import sys
import re

View File

@ -35,7 +35,7 @@
# isolation, but don't try to do any order checking between such blocks.
# ----------------------------------------------------------------------------
from __future__ import print_function
from __future__ import absolute_import, print_function
import difflib
import os

View File

@ -36,6 +36,7 @@
# mismatched alloc/free checking.
# ----------------------------------------------------------------------------
from __future__ import absolute_import
from __future__ import print_function
import argparse

View File

@ -6,6 +6,7 @@
# longer present in a complete update. The current working directory is used for
# the location to enumerate and to create the precomplete file.
from __future__ import absolute_import
from __future__ import unicode_literals
import os

View File

@ -4,6 +4,8 @@
# License, v. 2.0. If a copy of the MPL was not distibuted with this
# file, You can obtain one at http://mozilla.og/MPL/2.0/.
from __future__ import absolute_import
from __future__ import print_function
import buildconfig
import mozpack.path as mozpath
import os

View File

@ -4,6 +4,7 @@
# License, v. 2.0. If a copy of the MPL was not distibuted with this
# file, You can obtain one at http://mozilla.og/MPL/2.0/.
from __future__ import absolute_import
import sys
import buildconfig
from mozbuild.preprocessor import Preprocessor

View File

@ -4,6 +4,8 @@
# 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
def main(output, data_file, data_symbol):
output.write(''' AREA |.rdata|,ALIGN=4,DATA,READONLY

View File

@ -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
from __future__ import print_function
import os
import string

View File

@ -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
from __future__ import print_function
import os
from mozbuild.util import FileAvoidWrite

View File

@ -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 re
import textwrap
import string

View File

@ -164,6 +164,7 @@ class MockedOpen(object):
f.write('foo')
self.assertRaises(Exception,f.open('foo', 'r'))
'''
def __init__(self, files={}):
self.files = {}
for name, content in files.items():

View File

@ -9,6 +9,7 @@
# a full build environment set up.
# The basic limitation is, it doesn't even try to link and ignores
# all related options.
from __future__ import absolute_import
from __future__ import print_function
from optparse import OptionParser
import mozfile

View File

@ -2,6 +2,8 @@
# 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
from __future__ import print_function
import configobj
import sys
import re

View File

@ -9,6 +9,7 @@
# 2.1a3pre > ""
# 3.2b4 > " 3.2 Beta 4"
# 3.2b4pre > ""
from __future__ import absolute_import
from __future__ import print_function
import sys

View File

@ -2,6 +2,8 @@
# 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
from __future__ import print_function
"""
Run a python script, adding extra directories to the python path.
"""

View File

@ -2,6 +2,8 @@
# 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
from __future__ import print_function
import os
import errno

View File

@ -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 buildconfig
import subprocess
import sys

View File

@ -1,3 +1,4 @@
from __future__ import absolute_import
import os

View File

@ -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
from __future__ import unicode_literals
import os

View File

@ -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
from mozunit import main, MockedOpen
import unittest

View File

@ -1,3 +1,4 @@
from __future__ import absolute_import
import unittest
import os

View File

@ -1,3 +1,4 @@
from __future__ import absolute_import
import unittest
import mozunit

View File

@ -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 unittest
import shutil

View File

@ -5,7 +5,6 @@ py2:
exclude:
- build
- client.py
- config
- dom
- editor
- gfx

View File

@ -6,7 +6,6 @@ py3:
- browser/app
- build
- client.py
- config
- dom/bindings
- dom/media/test
- gfx