mirror of
https://github.com/savoirfairelinux/opendht.git
synced 2026-11-08 04:21:51 +00:00
python: check both done callback existence and value
This commit is contained in:
1 parent
c10494557c
commit
3dc1966dcc
1 file changed
+1
-1
+1
-1
@@ -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)
|
||||
|
||||
|
||||
Reference in new issue
Block a user