1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

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

This commit is contained in:
Tim Potter 2004-09-12 11:45:37 +00:00 committed by Gerald (Jerry) Carter
parent ec23bae00f
commit 05cff58070

View File

@ -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);
}