Commit 8b30a1ff authored by Denis Bilenko's avatar Denis Bilenko

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

--HG--
extra : transplant_source : %ED%01_%E4-Z%FC5%0C%89%AA%E8%B9%8A%FD%28%C47%81L
parent 3c67ec2b
...@@ -153,13 +153,13 @@ class Hub(greenlet): ...@@ -153,13 +153,13 @@ class Hub(greenlet):
assert cur is not self, 'Cannot switch to MAINLOOP from MAINLOOP' assert cur is not self, 'Cannot switch to MAINLOOP from MAINLOOP'
exc_info = sys.exc_info() exc_info = sys.exc_info()
try: try:
sys.exc_clear()
switch_out = getattr(cur, 'switch_out', None) switch_out = getattr(cur, 'switch_out', None)
if switch_out is not None: if switch_out is not None:
try: try:
switch_out() switch_out()
except: except:
traceback.print_exc() traceback.print_exc()
sys.exc_clear()
return greenlet.switch(self) return greenlet.switch(self)
finally: finally:
core.set_exc_info(*exc_info) 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