From d244b1ba77794c0bf021ae74465071f6e3d6cbca Mon Sep 17 00:00:00 2001 From: Kevin Froman Date: Tue, 22 Dec 2020 01:37:42 +0000 Subject: [PATCH] catch subprocess err in 3.9.x (dirty hack --- src/onionrproofs/subprocesspow.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/onionrproofs/subprocesspow.py b/src/onionrproofs/subprocesspow.py index 2923de74..a988b366 100755 --- a/src/onionrproofs/subprocesspow.py +++ b/src/onionrproofs/subprocesspow.py @@ -91,10 +91,17 @@ class SubprocessPOW: def _spawn_proc(self): """Create a child proof of work process wait for data and send shutdown signal when its found""" - parent_conn, child_conn = Pipe() - p = Process(target=self.do_pow, args=(child_conn,), daemon=True) - p.start() - #p.join() + # The importerror started happening in 3.9.x + # not worth fixing because this POW will be replaced by VDF + try: + parent_conn, child_conn = Pipe() + p = Process(target=self.do_pow, args=(child_conn,), daemon=True) + p.start() + except ImportError: + logger.error( + "Error in subprocess module when getting new POW " + + "pipe.\nThis is related to a problem in 3.9.x", terminal=True) + return payload = None try: while True: