From 53ede5967b4d50a38fef779c877b89d0349ce71b Mon Sep 17 00:00:00 2001 From: Batuhan Taskaya Date: Wed, 27 May 2020 18:21:55 +0300 Subject: [PATCH] is_tarfile accepts pathlike (#3804) --- stdlib/2and3/tarfile.pyi | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/stdlib/2and3/tarfile.pyi b/stdlib/2and3/tarfile.pyi index 309e06383..1a64c5910 100644 --- a/stdlib/2and3/tarfile.pyi +++ b/stdlib/2and3/tarfile.pyi @@ -177,7 +177,10 @@ class TarFile(Iterable[TarInfo]): fileobj: Optional[IO[bytes]] = ...) -> TarInfo: ... def close(self) -> None: ... -def is_tarfile(name: str) -> bool: ... +if sys.version_info >= (3, 9): + def is_tarfile(name: Union[_Path, IO[bytes]]) -> bool: ... +else: + def is_tarfile(name: _Path) -> bool: ... if sys.version_info < (3, 8): def filemode(mode: int) -> str: ... # undocumented