From 02fde0ad7005497521a3d0a54fc5d77a82b37d5f Mon Sep 17 00:00:00 2001 From: Kevin Froman Date: Fri, 21 Aug 2020 10:44:59 -0500 Subject: [PATCH] fix subprocesspow keyboard interrupt not being catched --- src/onionrproofs/subprocesspow.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/onionrproofs/subprocesspow.py b/src/onionrproofs/subprocesspow.py index e4852e8b..9b6b96cf 100755 --- a/src/onionrproofs/subprocesspow.py +++ b/src/onionrproofs/subprocesspow.py @@ -116,7 +116,10 @@ class SubprocessPOW: while True: # Break if shutdown received - if pipe.poll() and pipe.recv() == 'shutdown': + try: + if pipe.poll() and pipe.recv() == 'shutdown': + break + except KeyboardInterrupt: break # Load nonce into block metadata metadata['pow'] = nonce