From ce733c664144155e6136423e964c1d51f14a1b05 Mon Sep 17 00:00:00 2001 From: miruka Date: Fri, 27 Dec 2019 09:28:46 -0400 Subject: [PATCH] Catch signal exception when imported from thread --- src/backend/qml_bridge.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/backend/qml_bridge.py b/src/backend/qml_bridge.py index 30093f27..2a32fdbd 100644 --- a/src/backend/qml_bridge.py +++ b/src/backend/qml_bridge.py @@ -125,6 +125,11 @@ class QMLBridge: # Make CTRL-C work again -signal.signal(signal.SIGINT, signal.SIG_DFL) +try: + signal.signal(signal.SIGINT, signal.SIG_DFL) +except ValueError: + # FIXME - happens when we're imported from a thread, + # occurs in py3.8 but not 3.6? + pass BRIDGE = QMLBridge()