Merge branch 'feat/optional-uvloop-use' of github.com:prryplatypus/sanic into tests/optional-uvloop-use

This commit is contained in:
prryplatypus 2021-10-23 21:02:20 +02:00
commit 250c5cf60d
No known key found for this signature in database
GPG Key ID: 6687E128FB70819B
2 changed files with 2 additions and 3 deletions

View File

@ -12,6 +12,7 @@ UVLOOP_INSTALLED = False
try:
import uvloop # type: ignore # noqa
UVLOOP_INSTALLED = True
except ImportError:
pass

View File

@ -12,9 +12,7 @@ def use_uvloop() -> None:
"""
import uvloop # type: ignore
if not isinstance(
asyncio.get_event_loop_policy(), uvloop.EventLoopPolicy
):
if not isinstance(asyncio.get_event_loop_policy(), uvloop.EventLoopPolicy):
asyncio.set_event_loop_policy(uvloop.EventLoopPolicy())