mirror of
https://github.com/django/daphne.git
synced 2024-11-21 15:36:33 +03:00
Set event loop policy on Windows with Python 3.8+.
This commit is contained in:
parent
d689ca2eab
commit
5cf15bd636
|
@ -1 +1,14 @@
|
|||
import sys
|
||||
|
||||
__version__ = "2.4.1"
|
||||
|
||||
|
||||
# Windows on Python 3.8+ uses ProactorEventLoop, which is not compatible with
|
||||
# Twisted. Does not implement add_writer/add_reader.
|
||||
# See https://bugs.python.org/issue37373
|
||||
# and https://twistedmatrix.com/trac/ticket/9766
|
||||
PY38_WIN = sys.version_info >= (3, 8) and sys.platform == "win32"
|
||||
if PY38_WIN:
|
||||
import asyncio
|
||||
|
||||
asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())
|
||||
|
|
Loading…
Reference in New Issue
Block a user