summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Mac/Modules/res/ressupport.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/Mac/Modules/res/ressupport.py b/Mac/Modules/res/ressupport.py
index e2bfa79..fd4f4e6 100644
--- a/Mac/Modules/res/ressupport.py
+++ b/Mac/Modules/res/ressupport.py
@@ -30,6 +30,19 @@ includestuff = includestuff + """
"""
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 + """