From 9eb050da3b37bbeea49237b89ad1d5f9db7ce320 Mon Sep 17 00:00:00 2001 From: Lila Date: Fri, 27 Sep 2024 20:40:36 +0100 Subject: [PATCH] type hint fixes --- fast64_internal/sm64/sm64_utility.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/fast64_internal/sm64/sm64_utility.py b/fast64_internal/sm64/sm64_utility.py index 13b043811..a5910ae41 100644 --- a/fast64_internal/sm64/sm64_utility.py +++ b/fast64_internal/sm64/sm64_utility.py @@ -292,12 +292,12 @@ def to_include_descriptor(include: Path, *alternatives: Path): def write_includes( - path: Path, includes: list[Path] = None, path_must_exist=False, create_new=False, before_endif=False -) -> bool: + path: Path, includes: Optional[list[Path]] = None, path_must_exist=False, create_new=False, before_endif=False +): to_add = [] for include in includes or []: to_add.append(to_include_descriptor(include)) - write_or_delete_if_found( + return write_or_delete_if_found( path, to_add, path_must_exist=path_must_exist, @@ -312,9 +312,9 @@ def update_actor_includes( header_dir: Path, dir_name: str, level_name: str | None = None, # for backwards compatibility - data_includes: list[Path] = None, - header_includes: list[Path] = None, - geo_includes: list[Path] = None, + data_includes: Optional[list[Path]] = None, + header_includes: Optional[list[Path]] = None, + geo_includes: Optional[list[Path]] = None, ): if header_type == "Actor": if not group_name: @@ -331,7 +331,7 @@ def update_actor_includes( else: raise PluginError(f'Unknown header type "{header_type}"') - def write_includes_with_alternate(path: Path, includes: list[Path] | None, before_endif=False): + def write_includes_with_alternate(path: Path, includes: Optional[list[Path]], before_endif=False): if includes is None: return False if header_type == "Level":