mirror of
https://github.com/tiennm99/mtprotoproxy.git
synced 2026-10-12 18:16:33 +00:00
check for socks mode before importing uvloop
This commit is contained in:
1 parent
94fd98a1fb
commit
5e488203a2
1 file changed
+3
-3
+3
-3
@@ -2004,11 +2004,11 @@ def setup_signals():
|
||||
|
||||
|
||||
def try_setup_uvloop():
|
||||
if config.SOCKS5_HOST and config.SOCKS5_PORT:
|
||||
# socks mode is not compatible with uvloop
|
||||
return
|
||||
try:
|
||||
import uvloop
|
||||
if config.SOCKS5_HOST and config.SOCKS5_PORT:
|
||||
# socks mode is not compatible with uvloop
|
||||
return
|
||||
asyncio.set_event_loop_policy(uvloop.EventLoopPolicy())
|
||||
print_err("Found uvloop, using it for optimal performance")
|
||||
except ImportError:
|
||||
|
||||
Reference in new issue
Block a user