python: check both done callback existence and value

This commit is contained in:
Adrien Béraud committed 2015-07-29 17:27:44 -04:00
1 parent c10494557c
commit 3dc1966dcc
1 file changed
+1 -1
+1 -1
View File
@@ -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)