Skip to content

Commit 382c043

Browse files
authored
gh-146444: Make Platforms/Apple/ compatible with Python 3.9 (#146624)
Replace "str | None" with typing.Union[str, None].
1 parent 7f0c4f6 commit 382c043

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

Platforms/Apple/.ruff.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
extend = "../../.ruff.toml" # Inherit the project-wide settings
22

3+
# iOS buildbot worker uses Python 3.9
4+
target-version = "py39"
5+
36
[format]
47
preview = true
58
docstring-code-format = true

Platforms/Apple/__main__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,10 @@
5252
from os.path import basename, relpath
5353
from pathlib import Path
5454
from subprocess import CalledProcessError
55+
from typing import Union
5556

5657
EnvironmentT = dict[str, str]
57-
ArgsT = Sequence[str | Path]
58+
ArgsT = Sequence[Union[str, Path]]
5859

5960
SCRIPT_NAME = Path(__file__).name
6061
PYTHON_DIR = Path(__file__).resolve().parent.parent.parent

Platforms/Apple/testbed/__main__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import subprocess
88
import sys
99
from pathlib import Path
10+
from typing import Union
1011

1112
TEST_SLICES = {
1213
"iOS": "ios-arm64_x86_64-simulator",
@@ -262,7 +263,7 @@ def update_test_plan(testbed_path, platform, args):
262263

263264
def run_testbed(
264265
platform: str,
265-
simulator: str | None,
266+
simulator: Union[str, None],
266267
args: list[str],
267268
verbose: bool = False,
268269
):

0 commit comments

Comments
 (0)