Meta: Support python 3.9 in ladybird.py

This is the default python version on macOS, so let's support it since
it is trivial for now. Using "str | None" as a type annotation is only
supported in python 3.10 or later.
This commit is contained in:
Timothy Flynn 2025-05-28 10:39:17 -04:00 committed by Tim Flynn
commit 8e792cd094
Notes: github-actions[bot] 2025-05-29 23:35:27 +00:00

View file

@ -15,6 +15,7 @@ import subprocess
import sys
from pathlib import Path
from typing import Optional
sys.path.append(str(Path(__file__).resolve().parent.parent))
@ -329,7 +330,7 @@ def ensure_ladybird_source_dir() -> Path:
return ladybird_source_dir
def build_main(build_dir: Path, target: str | None = None, args: list[str] = []):
def build_main(build_dir: Path, target: Optional[str] = None, args: list[str] = []):
build_args = [
"cmake",
"--build",
@ -351,7 +352,7 @@ def build_main(build_dir: Path, target: str | None = None, args: list[str] = [])
sys.exit(1)
def test_main(build_dir: Path, preset: str, pattern: str | None):
def test_main(build_dir: Path, preset: str, pattern: Optional[str]):
test_args = [
"ctest",
"--preset",