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:
parent
ec23bae00f
commit
05cff58070
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user