Skip to content

Commit da3f733

Browse files
committed
Fixed issue #237
1 parent 7a58f6e commit da3f733

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

‎addons/source-python/packages/source-python/__init__.py‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,23 @@ def setup_exception_hooks():
234234
from hooks.exceptions import except_hooks
235235
from hooks.warnings import warning_hooks
236236

237+
# Temporary workaround for sys.excepthook bug:
238+
# https://bugs.python.org/issue1230540
239+
import sys
240+
import threading
241+
242+
run_old = threading.Thread.run
243+
244+
def run(*args, **kwargs):
245+
try:
246+
run_old(*args, **kwargs)
247+
except (KeyboardInterrupt, SystemExit):
248+
raise
249+
except:
250+
sys.excepthook(*sys.exc_info())
251+
252+
threading.Thread.run = run
253+
237254

238255
# =============================================================================
239256
# >> TRANSLATIONS

0 commit comments

Comments
 (0)