Commit 9f37c6d9 authored by Jack Jansen's avatar Jack Jansen

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

parent caf7505e
...@@ -30,6 +30,19 @@ includestuff = includestuff + """ ...@@ -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 + """
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment