correct type annotations for File.endswith

It should accept whatever str.endswith accepts, which means optionally a
tuple of options.
pull/9757/head
Eli Schwartz 3 years ago
parent db528e3bb9
commit 19c9f32cef
No known key found for this signature in database
GPG Key ID: CEB167EFB5722BD6
  1. 2
      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]:

Loading…
Cancel
Save