Don't print errors happened in thread

This commit is contained in:
shortcutme 2019-11-19 02:16:44 +01:00
parent 58214c0ac3
commit 4025d753e3
No known key found for this signature in database
GPG Key ID: 5B63BAE6CB9613AE
1 changed files with 4 additions and 0 deletions

View File

@ -74,6 +74,10 @@ else:
importlib.reload(gevent)
def handleGreenletError(context, type, value, tb):
if context.__class__ is tuple and context[0].__class__.__name__ == "ThreadPool":
# Exceptions in ThreadPool will be handled in the main Thread
return None
if isinstance(value, str):
# Cython can raise errors where the value is a plain string
# e.g., AttributeError, "_semaphore.Semaphore has no attr", <traceback>