From d85034353f0856288c4e73d0c13a8529c210f109 Mon Sep 17 00:00:00 2001 From: Neil Booth Date: Tue, 15 Nov 2016 20:13:50 +0900 Subject: [PATCH] Remove useless re-raise of cancellation --- electrumx_server.py | 8 ++------ server/block_processor.py | 1 - 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/electrumx_server.py b/electrumx_server.py index a0a505e..d851aa6 100755 --- a/electrumx_server.py +++ b/electrumx_server.py @@ -42,12 +42,8 @@ def main_loop(): loop.add_signal_handler(getattr(signal, signame), partial(on_signal, signame)) - try: - loop.run_until_complete(future) - except asyncio.CancelledError: - pass - finally: - loop.close() + loop.run_until_complete(future) + loop.close() def main(): diff --git a/server/block_processor.py b/server/block_processor.py index 9829497..63a3c88 100644 --- a/server/block_processor.py +++ b/server/block_processor.py @@ -388,7 +388,6 @@ class BlockProcessor(server.db.DB): self.on_cancel() # This lets the asyncio subsystem process futures cancellations await asyncio.sleep(0) - raise def on_cancel(self): '''Called when the main loop is cancelled.