mirror of
https://github.com/alexbers/mtprotoproxy.git
synced 2026-03-13 23:03:09 +00:00
check for socks mode before importing uvloop
This commit is contained in:
@@ -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