Displaying 1 result from an estimated 1 matches for "0206b80".
Did you mean:
0.0680
2018 Apr 05
1
[nbdkit PATCH] python: Make sure callbacks are actually callable
...the plugin.
Signed-off-by: Eric Blake <eblake@redhat.com>
---
Various examples on calling Python functions from C recommend
doing this filtering check.
plugins/python/python.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/plugins/python/python.c b/plugins/python/python.c
index 0206b80..35e8df2 100644
--- a/plugins/python/python.c
+++ b/plugins/python/python.c
@@ -94,6 +94,11 @@ callback_defined (const char *name, PyObject **obj_rtn)
obj = PyObject_GetAttrString (module, name);
if (!obj)
return 0;
+ if (!PyCallable_Check (obj)) {
+ nbdkit_debug ("object %s isn...