From f3bcaf9f88aad2c423ebcd61121562f9834187d4 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 8 Apr 2024 17:11:27 +0200 Subject: Merging upstream version 115.8.0esr. Signed-off-by: Daniel Baumann --- python/mozbuild/mozbuild/mach_commands.py | 6 +++--- python/mozbuild/mozbuild/nodeutil.py | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) (limited to 'python/mozbuild') diff --git a/python/mozbuild/mozbuild/mach_commands.py b/python/mozbuild/mozbuild/mach_commands.py index 2297d586b8..c00afd1c01 100644 --- a/python/mozbuild/mozbuild/mach_commands.py +++ b/python/mozbuild/mozbuild/mach_commands.py @@ -29,6 +29,7 @@ from mach.decorators import ( SettingsProvider, SubCommand, ) +from mozfile import load_source from voluptuous import All, Boolean, Required, Schema import mozbuild.settings # noqa need @SettingsProvider hook to execute @@ -1099,11 +1100,10 @@ def android_gtest( # run gtest via remotegtests.py exit_code = 0 - import imp path = os.path.join("testing", "gtest", "remotegtests.py") - with open(path, "r") as fh: - imp.load_module("remotegtests", fh, path, (".py", "r", imp.PY_SOURCE)) + load_source("remotegtests", path) + import remotegtests tester = remotegtests.RemoteGTests() diff --git a/python/mozbuild/mozbuild/nodeutil.py b/python/mozbuild/mozbuild/nodeutil.py index 8ec724ab89..42f2627cd9 100644 --- a/python/mozbuild/mozbuild/nodeutil.py +++ b/python/mozbuild/mozbuild/nodeutil.py @@ -5,14 +5,14 @@ import os import platform import subprocess -from distutils.version import StrictVersion from mozboot.util import get_tools_dir from mozfile import which +from packaging.version import Version from six import PY3 -NODE_MIN_VERSION = StrictVersion("12.22.12") -NPM_MIN_VERSION = StrictVersion("6.14.16") +NODE_MIN_VERSION = Version("12.22.12") +NPM_MIN_VERSION = Version("6.14.16") def find_node_paths(): @@ -68,7 +68,7 @@ def check_executable_version(exe, wrap_call_with_node=False): .lstrip("v") .rstrip() ) - return StrictVersion(out) + return Version(out) def find_node_executable( @@ -87,7 +87,7 @@ def find_node_executable( return None, None if version >= min_version: - return nodejs_exe, version.version + return nodejs_exe, version.release return None, None @@ -123,4 +123,4 @@ def find_executable(name, min_version, use_node_for_version_check=False): if version < min_version: return None, None - return exe, version.version + return exe, version.release -- cgit v1.2.3