Commits

Denis Bilenko  committed b571425

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

  • Participants
  • Parent commits 35958fb

Comments (0)

Files changed (1)

File gevent/core.ppyx

             return self._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, ))             \
             self._callback = callback                                                   \
                                                                                         \
-        def __del__(self):                                                              \
-            self._callback = None                                                       \
-                                                                                        \
     def stop(self):                                                                     \
         if self._flags & 2:                                                             \
             libev.ev_ref(self.loop._ptr)                                                \