summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorTim Potter <tpot@samba.org>2004-09-12 11:45:37 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:58:41 -0500
commita34ddd04ca89c4bff68dbfb873dcc1dfdbc096ef (patch)
treebb6b45273963369ae6646ed5b128bed851a09704 /source4
parent7436bdc4f0ad5ace62d9ac5b617f3844b5dda298 (diff)
downloadsamba-a34ddd04ca89c4bff68dbfb873dcc1dfdbc096ef.tar.gz
samba-a34ddd04ca89c4bff68dbfb873dcc1dfdbc096ef.tar.bz2
samba-a34ddd04ca89c4bff68dbfb873dcc1dfdbc096ef.zip
r2299: Map a (C) NULL pointer to (Python) None and vice versa.
(This used to be commit 05cff58070b7070157aea47c5da8512145c2774a)
Diffstat (limited to 'source4')
-rw-r--r--source4/scripting/swig/dcerpc.i6
1 files changed, 6 insertions, 0 deletions
diff --git a/source4/scripting/swig/dcerpc.i b/source4/scripting/swig/dcerpc.i
index 10c20d201f..9d5e9f295d 100644
--- a/source4/scripting/swig/dcerpc.i
+++ b/source4/scripting/swig/dcerpc.i
@@ -134,11 +134,17 @@ struct security_descriptor *security_descriptor_from_python(PyObject *obj)
char *string_from_python(PyObject *obj)
{
+ if (obj == Py_None)
+ return NULL;
+
return PyString_AsString(obj);
}
PyObject *string_to_python(char *obj)
{
+ if (obj == NULL)
+ return Py_None;
+
return PyString_FromString(obj);
}