mirror of
https://github.com/samba-team/samba.git
synced 2025-08-02 00:22:11 +03:00
net: Allow Python commands to return None instead of 0.
Signed-off-by: Andrew Tridgell <tridge@samba.org>
This commit is contained in:
committed by
Andrew Tridgell
parent
797977ac53
commit
552e65679d
@ -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)
|
||||
|
Reference in New Issue
Block a user