From a34ddd04ca89c4bff68dbfb873dcc1dfdbc096ef Mon Sep 17 00:00:00 2001 From: Tim Potter Date: Sun, 12 Sep 2004 11:45:37 +0000 Subject: r2299: Map a (C) NULL pointer to (Python) None and vice versa. (This used to be commit 05cff58070b7070157aea47c5da8512145c2774a) --- source4/scripting/swig/dcerpc.i | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'source4') 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); } -- cgit