diff --git a/sdk/mx.sdk/mx_sdk_shaded.py b/sdk/mx.sdk/mx_sdk_shaded.py index 1b96cd16ac2c..5f8538ac04c4 100644 --- a/sdk/mx.sdk/mx_sdk_shaded.py +++ b/sdk/mx.sdk/mx_sdk_shaded.py @@ -335,8 +335,8 @@ def glob_match(path, pattern): """ assert isinstance(path, PurePath), path if sys.version_info[:2] >= (3, 13): - # Since Python 3.13, PurePath.match already supports '**'. - return path.match(pattern) + # Python 3.13+: PurePath.full_match already supports '**'. + return path.full_match(pattern) pathType = type(path) patternParts = pathType(pattern).parts diff --git a/substratevm/mx.substratevm/mx_substratevm.py b/substratevm/mx.substratevm/mx_substratevm.py index bf0629adbcc8..ff64b6cc6003 100644 --- a/substratevm/mx.substratevm/mx_substratevm.py +++ b/substratevm/mx.substratevm/mx_substratevm.py @@ -30,7 +30,7 @@ from contextlib import contextmanager from itertools import islice from os.path import join, exists, dirname -import pipes +import shlex from argparse import ArgumentParser import fnmatch import collections @@ -645,7 +645,7 @@ def dummy_harness(test_deps, vm_launcher, vm_args): unittest_image = native_image(['-ea', '-esa'] + build_args + extra_image_args + [macro_junit + '=' + unittest_file] + svm_experimental_options(['-H:Path=' + junit_test_dir]), env=custom_env) image_pattern_replacement = unittest_image + ".exe" if mx.is_windows() else unittest_image run_args = [arg.replace('${unittest.image}', image_pattern_replacement) for arg in run_args] - mx.log('Running: ' + ' '.join(map(pipes.quote, [unittest_image] + run_args))) + mx.log('Running: ' + ' '.join(map(shlex.quote, [unittest_image] + run_args))) if not test_classes_per_run: # Run all tests in one go. The default behavior. diff --git a/sulong/mx.sulong/mx_sulong.py b/sulong/mx.sulong/mx_sulong.py index 5851ca8e9d6a..8544ae5d7f82 100644 --- a/sulong/mx.sulong/mx_sulong.py +++ b/sulong/mx.sulong/mx_sulong.py @@ -29,7 +29,7 @@ # import sys import os -import pipes +import shlex import tempfile from os.path import join import shutil @@ -166,7 +166,7 @@ def get_jacoco_setting(): def _subst_get_jvm_args(dep): java = mx.get_jdk().java main_class = mx.distribution(dep).mainClass - jvm_args = [pipes.quote(arg) for arg in mx.get_runtime_jvm_args([dep])] + jvm_args = [shlex.quote(arg) for arg in mx.get_runtime_jvm_args([dep])] cmd = [java] + jvm_args + [main_class] return " ".join(cmd) diff --git a/sulong/mx.sulong/mx_sulong_suite_constituents.py b/sulong/mx.sulong/mx_sulong_suite_constituents.py index dd86d5bc8f3b..5aa6a50747ca 100644 --- a/sulong/mx.sulong/mx_sulong_suite_constituents.py +++ b/sulong/mx.sulong/mx_sulong_suite_constituents.py @@ -32,7 +32,7 @@ import abc import fnmatch -import pipes +import shlex import mx import mx_cmake @@ -419,7 +419,7 @@ def clean(self, forBuild=False): def contents(self, tool, exe): # platform support all_params = '%*' if mx.is_windows() else '"$@"' - _quote = _quote_windows if mx.is_windows() else pipes.quote + _quote = _quote_windows if mx.is_windows() else shlex.quote # build command line java = mx.get_jdk().java classpath_deps = [dep for dep in self.subject.buildDependencies if isinstance(dep, mx.ClasspathDependency)]