svn commit: samba r2299 - in branches/SAMBA_4_0/source/scripting/swig: .

tpot at samba.org tpot at samba.org
Sun Sep 12 11:45:37 GMT 2004


Author: tpot
Date: 2004-09-12 11:45:37 +0000 (Sun, 12 Sep 2004)
New Revision: 2299

WebSVN: http://websvn.samba.org/websvn/changeset.php?rep=samba&path=/branches/SAMBA_4_0/source/scripting/swig&rev=2299&nolog=1

Log:
Map a (C) NULL pointer to (Python) None and vice versa.

Modified:
   branches/SAMBA_4_0/source/scripting/swig/dcerpc.i


Changeset:
Modified: branches/SAMBA_4_0/source/scripting/swig/dcerpc.i
===================================================================
--- branches/SAMBA_4_0/source/scripting/swig/dcerpc.i	2004-09-12 10:56:11 UTC (rev 2298)
+++ branches/SAMBA_4_0/source/scripting/swig/dcerpc.i	2004-09-12 11:45:37 UTC (rev 2299)
@@ -134,11 +134,17 @@
 
 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);
 }
 



More information about the samba-cvs mailing list