Commit 61af679f authored by Denis Bilenko's avatar Denis Bilenko

core: allow 'callback' property of a watcher to be set to None; del .callback...

core: allow 'callback' property of a watcher to be set to None; del .callback is no longer supported
parent 4a420d07
...@@ -541,13 +541,10 @@ cdef public class loop [object PyGeventLoopObject, type PyGeventLoop_Type]: ...@@ -541,13 +541,10 @@ cdef public class loop [object PyGeventLoopObject, type PyGeventLoop_Type]:
return self._callback \ return self._callback \
\ \
def __set__(self, object callback): \ def __set__(self, object callback): \
if not PyCallable_Check(<PyObjectPtr>callback): \ if not PyCallable_Check(<PyObjectPtr>callback) and callback is not None: \
raise TypeError("Expected callable, not %r" % (callback, )) \ raise TypeError("Expected callable, not %r" % (callback, )) \
self._callback = callback \ self._callback = callback \
\ \
def __del__(self): \
self._callback = None \
\
def stop(self): \ def stop(self): \
if self._flags & 2: \ if self._flags & 2: \
libev.ev_ref(self.loop._ptr) \ libev.ev_ref(self.loop._ptr) \
......
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