Commit 266ab4c3 authored by Denis Bilenko's avatar Denis Bilenko

Hub: better handle_system_error

make sure we deliver exception to MAIN greenlet even if loop.run_callback fails
parent 0c3d787e
...@@ -320,11 +320,16 @@ class Hub(greenlet): ...@@ -320,11 +320,16 @@ class Hub(greenlet):
else: else:
# in case system error was handled and life goes on # in case system error was handled and life goes on
# switch back to this greenlet as well # switch back to this greenlet as well
cb = self.loop.run_callback(current.switch) cb = None
try:
cb = self.loop.run_callback(current.switch)
except:
traceback.print_exc()
try: try:
self.parent.throw(type, value) self.parent.throw(type, value)
finally: finally:
cb.stop() if cb is not None:
cb.stop()
def print_exception(self, context, type, value, tb): def print_exception(self, context, type, value, tb):
traceback.print_exception(type, value, tb) traceback.print_exception(type, value, tb)
......
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