https://github.com/python/cpython/commit/836e5abfb3616c025c82bf99f5bd7c7b7ab97627
commit: 836e5abfb3616c025c82bf99f5bd7c7b7ab97627
branch: 3.14
author: Miss Islington (bot) <[email protected]>
committer: vstinner <[email protected]>
date: 2026-03-30T09:41:50Z
summary:

[3.14] gh-146444: Make Platforms/Apple/ compatible with Python 3.9 (GH-146624) 
(#146627)

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 <[email protected]>

files:
M Apple/.ruff.toml
M Apple/__main__.py
M Apple/testbed/__main__.py

diff --git a/Apple/.ruff.toml b/Apple/.ruff.toml
index 4cdc39ebee4be9..ce3be314f690d7 100644
--- a/Apple/.ruff.toml
+++ b/Apple/.ruff.toml
@@ -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
diff --git a/Apple/__main__.py b/Apple/__main__.py
index 96b8cb2a012114..862a471cb8c142 100644
--- a/Apple/__main__.py
+++ b/Apple/__main__.py
@@ -52,9 +52,10 @@
 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
diff --git a/Apple/testbed/__main__.py b/Apple/testbed/__main__.py
index 0dd77ab8b82797..96da1f9c7525f1 100644
--- a/Apple/testbed/__main__.py
+++ b/Apple/testbed/__main__.py
@@ -7,6 +7,7 @@
 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,
 ):

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to