1
0

Merge pull request #2339 from bauerj/error-window

Semi-automated crash reporting
This commit is contained in:
ThomasV
2018-01-30 11:16:42 +01:00
committed by GitHub
4 changed files with 222 additions and 3 deletions

View File

@@ -707,3 +707,29 @@ class QueuePipe:
self.send(request)
def setup_thread_excepthook():
"""
Workaround for `sys.excepthook` thread bug from:
http://bugs.python.org/issue1230540
Call once from the main thread before creating any threads.
"""
init_original = threading.Thread.__init__
def init(self, *args, **kwargs):
init_original(self, *args, **kwargs)
run_original = self.run
def run_with_except_hook(*args2, **kwargs2):
try:
run_original(*args2, **kwargs2)
except Exception:
sys.excepthook(*sys.exc_info())
self.run = run_with_except_hook
threading.Thread.__init__ = init