From ff6b826e136f584c8e65a40df6f62c761e7c6c51 Mon Sep 17 00:00:00 2001 From: Alexander Bersenev Date: Mon, 26 Aug 2019 16:51:48 +0500 Subject: [PATCH] do not output canceled errors to get rid from scarry traceback on the proxy termination --- mtprotoproxy.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mtprotoproxy.py b/mtprotoproxy.py index b3c7b6c..be3287a 100755 --- a/mtprotoproxy.py +++ b/mtprotoproxy.py @@ -1493,7 +1493,9 @@ async def handle_client(reader_clt, writer_clt): async def handle_client_wrapper(reader, writer): try: await handle_client(reader, writer) - except (asyncio.IncompleteReadError, ConnectionResetError, TimeoutError): + except (asyncio.IncompleteReadError, asyncio.CancelledError): + pass + except (ConnectionResetError, TimeoutError): pass except Exception: traceback.print_exc()