]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.14] gh-146444: Make Platforms/Apple/ compatible with Python 3.9 (GH-146624) (...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Mon, 30 Mar 2026 09:41:50 +0000 (11:41 +0200)
committerGitHub <noreply@github.com>
Mon, 30 Mar 2026 09:41:50 +0000 (09:41 +0000)
gh-146444: Make Platforms/Apple/ compatible with Python 3.9 (GH-146624)

Replace "str | None" with typing.Union[str, None].
(cherry picked from commit 382c04308d7c3638fc0402116ce8654b80b4b776)

Co-authored-by: Victor Stinner <vstinner@python.org>
Apple/.ruff.toml
Apple/__main__.py
Apple/testbed/__main__.py

index 4cdc39ebee4be9baa90aec6a317e9c63ebd81444..ce3be314f690d7ce5d40b8cc7e820e7435fb5032 100644 (file)
@@ -1,5 +1,8 @@
 extend = "../.ruff.toml"  # Inherit the project-wide settings
 
+# iOS buildbot worker uses Python 3.9
+target-version = "py39"
+
 [format]
 preview = true
 docstring-code-format = true
index 96b8cb2a0121146ee286b8c9fd8f10acb30a6234..862a471cb8c142aaa03b2cbffd42b3c007fbcc2f 100644 (file)
@@ -52,9 +52,10 @@ from datetime import datetime, timezone
 from os.path import basename, relpath
 from pathlib import Path
 from subprocess import CalledProcessError
+from typing import Union
 
 EnvironmentT = dict[str, str]
-ArgsT = Sequence[str | Path]
+ArgsT = Sequence[Union[str, Path]]
 
 SCRIPT_NAME = Path(__file__).name
 PYTHON_DIR = Path(__file__).resolve().parent.parent
index 0dd77ab8b827974ea5b8ebd3c48ee47f9538c612..96da1f9c7525f1f55d6e9aaf158cb29745082272 100644 (file)
@@ -7,6 +7,7 @@ import shutil
 import subprocess
 import sys
 from pathlib import Path
+from typing import Union
 
 TEST_SLICES = {
     "iOS": "ios-arm64_x86_64-simulator",
@@ -262,7 +263,7 @@ def update_test_plan(testbed_path, platform, args):
 
 def run_testbed(
     platform: str,
-    simulator: str | None,
+    simulator: Union[str, None],
     args: list[str],
     verbose: bool = False,
 ):