From 5e488203a2ab481b0e8976b0242bde39293896f3 Mon Sep 17 00:00:00 2001 From: Alexander Bersenev Date: Fri, 20 Sep 2019 17:26:30 +0500 Subject: [PATCH] check for socks mode before importing uvloop --- mtprotoproxy.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mtprotoproxy.py b/mtprotoproxy.py index 325a014..6cbfcb4 100755 --- a/mtprotoproxy.py +++ b/mtprotoproxy.py @@ -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: