Adding exc_clear to hub.switch, since things don't like it when exceptions from other coroutines get up in their thing.

This commit is contained in:
Ryan Williams
2010-02-14 18:33:03 -08:00
parent 7fb4f59ac8
commit 4cfaf65d79

View File

@@ -100,7 +100,7 @@ class BaseHub(object):
try:
switch_out()
except:
traceback.print_exception(*sys.exc_info())
self.squelch_generic_exception(sys.exc_info())
if self.greenlet.dead:
self.greenlet = greenlet.greenlet(self.run)
try:
@@ -109,6 +109,7 @@ class BaseHub(object):
current.parent = self.greenlet
except ValueError:
pass # gets raised if there is a greenlet parent cycle
sys.exc_clear()
return self.greenlet.switch()
def squelch_exception(self, fileno, exc_info):