From d500d4002434181faa9562c979d5b5733c7cf622 Mon Sep 17 00:00:00 2001 From: Stainless Bot Date: Mon, 6 Nov 2023 03:19:56 +0000 Subject: [PATCH] fix: prevent TypeError in Python 3.8 (ABC is not subscriptable) --- src/lithic/_types.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/lithic/_types.py b/src/lithic/_types.py index 0f250077..3952a70b 100644 --- a/src/lithic/_types.py +++ b/src/lithic/_types.py @@ -191,7 +191,10 @@ async def aclose(self) -> None: # while adding support for `PathLike` instances ProxiesDict = Dict["str | URL", Union[None, str, URL, Proxy]] ProxiesTypes = Union[str, Proxy, ProxiesDict] -FileContent = Union[IO[bytes], bytes, PathLike[str]] +if TYPE_CHECKING: + FileContent = Union[IO[bytes], bytes, PathLike[str]] +else: + FileContent = Union[IO[bytes], bytes, PathLike] # PathLike is not subscriptable in Python 3.8. FileTypes = Union[ # file (or bytes) FileContent,