git.samba.org
/
kai
/
samba.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
797977a
)
net: Allow Python commands to return None instead of 0.
author
Jelmer Vernooij
<jelmer@samba.org>
Wed, 30 Dec 2009 17:01:24 +0000
(18:01 +0100)
committer
Andrew Tridgell
<tridge@samba.org>
Thu, 31 Dec 2009 06:33:21 +0000
(17:33 +1100)
Signed-off-by: Andrew Tridgell <tridge@samba.org>
source4/utils/net/net.c
patch
|
blob
|
history
diff --git
a/source4/utils/net/net.c
b/source4/utils/net/net.c
index ee5cdf8e1c477049be708e87abdb097d0403cb61..ba935b998667b3c82aff1dc4d2d512b1098eb1e2 100644
(file)
--- 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)