Commit c590bd32 authored by Denis Bilenko's avatar Denis Bilenko

check for return value of event_del(); raise IOError if it failed

parent 66962674
......@@ -225,8 +225,11 @@ cdef class event:
def cancel(self):
"""Remove event from the event queue."""
cdef int result
if event_pending(&self.ev, EV_TIMEOUT|EV_SIGNAL|EV_READ|EV_WRITE, NULL):
event_del(&self.ev)
result = event_del(&self.ev)
if result < 0:
raise IOError(errno, strerror(errno))
Py_DECREF(self)
def __repr__(self):
......
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