Skip to content

Commit fc12d83

Browse files
fix: prevent TypeError in Python 3.8 (ABC is not subscriptable) (#170)
1 parent 37fe000 commit fc12d83

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/finch/_types.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,10 @@ async def aclose(self) -> None:
191191
# while adding support for `PathLike` instances
192192
ProxiesDict = Dict["str | URL", Union[None, str, URL, Proxy]]
193193
ProxiesTypes = Union[str, Proxy, ProxiesDict]
194-
FileContent = Union[IO[bytes], bytes, PathLike[str]]
194+
if TYPE_CHECKING:
195+
FileContent = Union[IO[bytes], bytes, PathLike[str]]
196+
else:
197+
FileContent = Union[IO[bytes], bytes, PathLike] # PathLike is not subscriptable in Python 3.8.
195198
FileTypes = Union[
196199
# file (or bytes)
197200
FileContent,

0 commit comments

Comments
 (0)