Fix Python 3.10 collections import

This commit is contained in:
vslg 2021-11-19 13:12:42 -03:00
parent 9a4ababd9a
commit 4cffbaa68d

View File

@ -4,7 +4,6 @@
"""Various utilities that are used throughout the package.""" """Various utilities that are used throughout the package."""
import asyncio import asyncio
import collections
import html import html
import inspect import inspect
import io import io
@ -43,6 +42,11 @@ else:
from async_generator import asynccontextmanager from async_generator import asynccontextmanager
current_task = asyncio.Task.current_task current_task = asyncio.Task.current_task
if sys.version_info >= (3, 10):
import collections.abc as collections
else:
import collections
Size = Tuple[int, int] Size = Tuple[int, int]
BytesOrPIL = Union[bytes, PILImage.Image] BytesOrPIL = Union[bytes, PILImage.Image]
auto = autostr auto = autostr