Use selector event loop for Python 3.8+ on windows

pull/209/head
Sheng 2020-10-02 11:29:48 +08:00
parent 19d816f991
commit 760c74a2f7
1 changed files with 7 additions and 0 deletions

View File

@ -1,4 +1,11 @@
import sys
from webssh._version import __version__, __version_info__
__author__ = 'Shengdun Hua <webmaster0115@gmail.com>'
if sys.platform == 'win32' and sys.version_info.major == 3 and \
sys.version_info.minor >= 8:
import asyncio
asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())