summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source4/utils/net/net.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/source4/utils/net/net.c b/source4/utils/net/net.c
index ee5cdf8e1c..ba935b9986 100644
--- a/source4/utils/net/net.c
+++ b/source4/utils/net/net.c
@@ -94,7 +94,14 @@ static int py_call_with_string_args(PyObject *self, const char *method, int argc
return 1;
}
- return PyInt_AsLong(ret);
+ if (ret == Py_None) {
+ return 0;
+ } else if (PyInt_Check(ret)) {
+ return PyInt_AsLong(ret);
+ } else {
+ fprintf(stderr, "Function return value type unexpected.\n");
+ return -1;
+ }
}
static PyObject *py_commands(void)