coros.event: use pop instead of del, because the latter may fail if event was cancelled

This commit is contained in:
Denis Bilenko
2008-11-19 00:32:14 +06:00
parent 3cd833a4a0
commit a36ab187b4

View File

@@ -135,7 +135,7 @@ class event(object):
try:
return api.get_hub().switch()
finally:
del self._waiters[api.getcurrent()]
self._waiters.pop(api.getcurrent(), None)
if self._exc is not None:
raise self._exc
return self._result