randydev commited on
Commit
91578b3
·
verified ·
1 Parent(s): 07c171b

Create asyncioPoliciesFix.py

Browse files
Files changed (1) hide show
  1. helper/asyncioPoliciesFix.py +15 -0
helper/asyncioPoliciesFix.py ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import asyncio
2
+ import sys
3
+
4
+
5
+ def decorator_asyncio_fix(func):
6
+ def wrapper(*args):
7
+ if (
8
+ sys.version_info[0] == 3
9
+ and sys.version_info[1] >= 8
10
+ and sys.platform.startswith("win")
11
+ ):
12
+ asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())
13
+ return func(*args)
14
+
15
+ return wrapper