diff --git a/.flake8 b/.flake8 index 3ab84b7a578d..58b69c44f0cf 100644 --- a/.flake8 +++ b/.flake8 @@ -17,7 +17,6 @@ exclude = netwerk/protocol/http/make_incoming_tables.py, python/devtools/migrate-l10n/migrate/main.py, python/l10n/fluent_migrations, - python/mozbuild/mozbuild/fork_interpose.py, security/manager/ssl/tests/unit, servo/components/style, testing/condprofile/condprof/android.py, diff --git a/python/mozbuild/mozbuild/fork_interpose.py b/python/mozbuild/mozbuild/fork_interpose.py deleted file mode 100644 index 567c70f2f0d4..000000000000 --- a/python/mozbuild/mozbuild/fork_interpose.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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/. - -# This source code is indirectly used in python/mozbuild/mozbuild/util.py and -# is not meant to be imported. This file can be entirely deleted when the -# transition to Python 3 is complete. - -import imp -import os -import sys - -orig_find_module = imp.find_module - -def my_find_module(name, dirs): - if name == main_module_name: - path = os.path.join(dirs[0], main_file_name) - f = open(path) - return (f, path, ('', 'r', imp.PY_SOURCE)) - return orig_find_module(name, dirs) - -# Don't allow writing bytecode file for the main module. -orig_load_module = imp.load_module - -def my_load_module(name, file, path, description): - # multiprocess.forking invokes imp.load_module manually and - # hard-codes the name __parents_main__ as the module name. - if name == '__parents_main__': - old_bytecode = sys.dont_write_bytecode - sys.dont_write_bytecode = True - try: - return orig_load_module(name, file, path, description) - finally: - sys.dont_write_bytecode = old_bytecode - - return orig_load_module(name, file, path, description) - -imp.find_module = my_find_module -imp.load_module = my_load_module -from multiprocessing.forking import main - -main() diff --git a/tools/lint/black.yml b/tools/lint/black.yml index 79fdee13427b..d4f05925bc00 100644 --- a/tools/lint/black.yml +++ b/tools/lint/black.yml @@ -4,7 +4,6 @@ black: exclude: - gfx/harfbuzz/src/meson.build - layout/style/ServoCSSPropList.mako.py - - python/mozbuild/mozbuild/fork_interpose.py - python/mozbuild/mozbuild/test/frontend/data/reader-error-syntax/moz.build - testing/mozharness/configs/test/test_malformed.py - testing/web-platform/tests