Commit 7bf6cdd6 authored by Denis Bilenko's avatar Denis Bilenko

Hub: add new NOT_ERROR attribute equal to (GreenletExit, ) that lists the...

Hub: add new NOT_ERROR attribute equal to (GreenletExit, ) that lists the exceptions that do not require printing a traceback
parent 2a9986bd
...@@ -204,6 +204,7 @@ class Hub(greenlet): ...@@ -204,6 +204,7 @@ class Hub(greenlet):
""" """
SYSTEM_ERROR = (KeyboardInterrupt, SystemExit, SystemError) SYSTEM_ERROR = (KeyboardInterrupt, SystemExit, SystemError)
NOT_ERROR = (GreenletExit, )
loop_class = 'gevent.core.loop' loop_class = 'gevent.core.loop'
resolver_class = ['gevent.resolver_ares.Resolver', resolver_class = ['gevent.resolver_ares.Resolver',
'gevent.socket.BlockingResolver'] 'gevent.socket.BlockingResolver']
...@@ -224,7 +225,8 @@ class Hub(greenlet): ...@@ -224,7 +225,8 @@ class Hub(greenlet):
self.pformat = _import(self.pformat) self.pformat = _import(self.pformat)
def handle_error(self, where, type, value, tb): def handle_error(self, where, type, value, tb):
traceback.print_exception(type, value, tb) if not issubclass(type, self.NOT_ERROR):
traceback.print_exception(type, value, tb)
del tb del tb
if where is None or issubclass(type, self.SYSTEM_ERROR): if where is None or issubclass(type, self.SYSTEM_ERROR):
current = getcurrent() current = getcurrent()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment