Commit 477e7ca2 authored by Denis Bilenko's avatar Denis Bilenko

hub.py: do sys.exc_clear() after switch_out() rather than before

parent 16b8e316
......@@ -171,13 +171,13 @@ class Hub(greenlet):
assert cur is not self, 'Impossible to call blocking function in the event loop callback'
exc_info = sys.exc_info()
try:
sys.exc_clear()
switch_out = getattr(cur, 'switch_out', None)
if switch_out is not None:
try:
switch_out()
except:
traceback.print_exc()
sys.exc_clear()
return greenlet.switch(self)
finally:
core.set_exc_info(*exc_info)
......
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