Fix utils.py import for Python 3.6

This commit is contained in:
miruka 2020-03-14 17:32:05 -04:00
parent d3e01b938c
commit cc3bb3c4fd
2 changed files with 19 additions and 13 deletions

View File

@ -1,14 +1,15 @@
Pillow >= 5.4.1, < 6 Pillow >= 5.4.1, < 6
pymediainfo >= 4.1, < 5 pymediainfo >= 4.1, < 5
cairosvg >= 2.4.2, < 3 cairosvg >= 2.4.2, < 3
aiofiles >= 0.4.0, < 0.5 aiofiles >= 0.4.0, < 0.5
appdirs >= 1.4.3, < 2 appdirs >= 1.4.3, < 2
filetype >= 1.0.5, < 2 filetype >= 1.0.5, < 2
html_sanitizer >= 1.7.3, < 2 html_sanitizer >= 1.7.3, < 2
lxml >= 4.4.2, < 5 lxml >= 4.4.2, < 5
mistune >= 0.8.4, < 0.9 mistune >= 0.8.4, < 0.9
dataclasses >= 0.6, < 0.7; python_version < "3.7" blist >= 1.3.6, < 2
pyfastcopy >= 1.0.3, < 2; python_version < "3.8" dataclasses >= 0.6, < 0.7; python_version < "3.7"
blist >= 1.3.6, < 2 async_generator >= 1.10, < 2; python_version < "3.7"
pyfastcopy >= 1.0.3, < 2; python_version < "3.8"
git+http://github.com/mirukan/matrix-nio#egg=matrix-nio[e2e] git+http://github.com/mirukan/matrix-nio#egg=matrix-nio[e2e]

View File

@ -7,8 +7,8 @@ import html
import inspect import inspect
import io import io
import json import json
import sys
import xml.etree.cElementTree as xml_etree # FIXME: bandit warning import xml.etree.cElementTree as xml_etree # FIXME: bandit warning
from contextlib import asynccontextmanager
from datetime import datetime, timedelta from datetime import datetime, timedelta
from enum import Enum from enum import Enum
from enum import auto as autostr from enum import auto as autostr
@ -28,6 +28,11 @@ from aiofiles.threadpool.text import AsyncTextIOWrapper
from nio.crypto import AsyncDataT as File from nio.crypto import AsyncDataT as File
from nio.crypto import async_generator_from_data from nio.crypto import async_generator_from_data
if sys.version_info >= (3, 7):
from contextlib import asynccontextmanager
else:
from async_generator import asynccontextmanager
Size = Tuple[int, int] Size = Tuple[int, int]
auto = autostr auto = autostr