Commits

Jack Jansen committed 8987cfa

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

  • Participants
  • Parent commits 5911f24
  • Branches legacy-trunk

Comments (0)

Files changed (1)

File Mac/Modules/res/ressupport.py

 """
 
 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 + """