From 3dc1966dcc6f9d407193832b030890132159fae6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrien=20B=C3=A9raud?= <adrien.beraud@savoirfairelinux.com> Date: Wed, 29 Jul 2015 17:27:44 -0400 Subject: [PATCH] python: check both done callback existence and value --- python/opendht.pyx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/opendht.pyx b/python/opendht.pyx index 18b2a62e..265c3baa 100644 --- a/python/opendht.pyx +++ b/python/opendht.pyx @@ -151,7 +151,7 @@ cdef void py_done_callback(bool done, vector[shared_ptr[Node]]* nodes, void *use h._v.second = n node_ids.append(h) cbs = <object>user_data - if 'done' in cbs: + if 'done' in cbs and cbs['done']: cbs['done'](done, node_ids) ref.Py_DECREF(cbs) -- GitLab