From 19c9f32cefdffb7d633eedada2b31059301fb106 Mon Sep 17 00:00:00 2001 From: Eli Schwartz Date: Thu, 16 Dec 2021 22:48:25 -0500 Subject: correct type annotations for File.endswith It should accept whatever str.endswith accepts, which means optionally a tuple of options. --- mesonbuild/mesonlib/universal.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mesonbuild/mesonlib/universal.py b/mesonbuild/mesonlib/universal.py index bae80d4ef..493acefe4 100644 --- a/mesonbuild/mesonlib/universal.py +++ b/mesonbuild/mesonlib/universal.py @@ -425,7 +425,7 @@ class File(HoldableObject): def suffix(self) -> str: return os.path.splitext(self.fname)[1][1:].lower() - def endswith(self, ending: str) -> bool: + def endswith(self, ending: T.Union[str, T.Tuple[str, ...]]) -> bool: return self.fname.endswith(ending) def split(self, s: str, maxsplit: int = -1) -> T.List[str]: -- cgit v1.2.3