diff options
author | Tim Potter <tpot@samba.org> | 2004-09-12 11:45:37 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:58:41 -0500 |
commit | a34ddd04ca89c4bff68dbfb873dcc1dfdbc096ef (patch) | |
tree | bb6b45273963369ae6646ed5b128bed851a09704 /source4/scripting/swig | |
parent | 7436bdc4f0ad5ace62d9ac5b617f3844b5dda298 (diff) | |
download | samba-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/scripting/swig')
-rw-r--r-- | source4/scripting/swig/dcerpc.i | 6 |
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); } |