Added ResObj_OptNew, like ResObj_New but returns None when passed NULL.

This commit is contained in:
Jack Jansen 1995-08-17 14:29:23 +00:00
parent caf7505edc
commit 9f37c6d91c
1 changed files with 13 additions and 0 deletions

View File

@ -30,6 +30,19 @@ includestuff = includestuff + """
""" """
finalstuff = finalstuff + """ finalstuff = finalstuff + """
/* Alternative version of ResObj_New, which returns None for null argument */
PyObject *ResObj_OptNew(itself)
Handle itself;
{
ResourceObject *it;
if (itself == NULL) {
Py_INCREF(Py_None);
return Py_None;
}
return ResObj_New(itself);
}
""" """
initstuff = initstuff + """ initstuff = initstuff + """