Fix conditional imports for pyright (#1839)
This commit is contained in:
parent
513a6aa067
commit
c24bbb85a6
@ -7,9 +7,9 @@ import sys
|
||||
|
||||
# `contextlib.asynccontextmanager` exists from Python 3.7 onwards.
|
||||
# For 3.6 we require the `async_generator` package for a backported version.
|
||||
try:
|
||||
if sys.version_info >= (3, 7):
|
||||
from contextlib import asynccontextmanager # type: ignore
|
||||
except ImportError:
|
||||
else:
|
||||
from async_generator import asynccontextmanager # type: ignore # noqa
|
||||
|
||||
# Brotli support is optional
|
||||
|
||||
Loading…
Reference in New Issue
Block a user