From e59279cc08cb3d1369d185857b6bab88a13d0185 Mon Sep 17 00:00:00 2001 From: Neil Booth Date: Sat, 3 Dec 2016 11:01:57 +0900 Subject: [PATCH] Reduce message spew on clean shutdown --- electrumx_server.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/electrumx_server.py b/electrumx_server.py index 7129a8a..a749949 100755 --- a/electrumx_server.py +++ b/electrumx_server.py @@ -41,7 +41,7 @@ def main_loop(): def on_exception(loop, context): '''Suppress spurious messages it appears we cannot control.''' message = context.get('message') - if not message in SUPPRESS_MESSAGES: + if not loop.is_closed() and not message in SUPPRESS_MESSAGES: if not ('task' in context and 'accept_connection2()' in repr(context.get('task'))): loop.default_exception_handler(context)