Commit 4a7f601a authored by Denis Bilenko's avatar Denis Bilenko

make 'fd' and 'events' properties writeable when watches is not active

parent 2a27d7b2
......@@ -491,11 +491,21 @@ cdef class io(watcher):
def __get__(self):
return self._watcher.fd
def __set__(self, int fd):
if libev.ev_is_active(&self._watcher):
raise AttributeError("'io' watcher attribute 'fd' is read-only while watcher is active")
libev.ev_io_init(&self._watcher, <void *>gevent_io_callback, fd, self._watcher.events)
property events:
def __get__(self):
return self._watcher.events
def __set__(self, int events):
if libev.ev_is_active(&self._watcher):
raise AttributeError("'io' watcher attribute 'events' is read-only while watcher is active")
libev.ev_io_init(&self._watcher, <void *>gevent_io_callback, self._watcher.fd, events)
property events_str:
def __get__(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