зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1708260: Remove "imp" usage when loading Mach r=firefox-build-system-reviewers,glandium
We always run on Python 3.6+, so the `imp` usage was dead code. Differential Revision: https://phabricator.services.mozilla.com/D120398
This commit is contained in:
Родитель
c494ddeedd
Коммит
1db9ce10c0
14
mach
14
mach
|
@ -125,16 +125,12 @@ from __future__ import absolute_import, print_function, unicode_literals
|
|||
import os
|
||||
import sys
|
||||
|
||||
def load_mach(dir_path, mach_path):
|
||||
if sys.version_info < (3, 5):
|
||||
import imp
|
||||
mach_bootstrap = imp.load_source('mach_bootstrap', mach_path)
|
||||
else:
|
||||
import importlib.util
|
||||
spec = importlib.util.spec_from_file_location('mach_bootstrap', mach_path)
|
||||
mach_bootstrap = importlib.util.module_from_spec(spec)
|
||||
spec.loader.exec_module(mach_bootstrap)
|
||||
|
||||
def load_mach(dir_path, mach_path):
|
||||
import importlib.util
|
||||
spec = importlib.util.spec_from_file_location('mach_bootstrap', mach_path)
|
||||
mach_bootstrap = importlib.util.module_from_spec(spec)
|
||||
spec.loader.exec_module(mach_bootstrap)
|
||||
return mach_bootstrap.bootstrap(dir_path)
|
||||
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче