From 1db9ce10c0f0d5949f4e8640d9e5ce6cf19e4543 Mon Sep 17 00:00:00 2001 From: Mitchell Hentges Date: Fri, 3 Sep 2021 20:46:21 +0000 Subject: [PATCH] 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 --- mach | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/mach b/mach index 7836bc5e3fbc..59e4532729b2 100755 --- a/mach +++ b/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)