summaryrefslogtreecommitdiffstats
path: root/Mac/Modules/res/Resmodule.c
diff options
context:
space:
mode:
Diffstat (limited to 'Mac/Modules/res/Resmodule.c')
-rw-r--r--Mac/Modules/res/Resmodule.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/Mac/Modules/res/Resmodule.c b/Mac/Modules/res/Resmodule.c
index d3ec0ea..4e8ed8f 100644
--- a/Mac/Modules/res/Resmodule.c
+++ b/Mac/Modules/res/Resmodule.c
@@ -14,6 +14,7 @@
#include <Controls.h>
extern PyObject *ResObj_New(Handle);
+extern PyObject *ResObj_OptNew(Handle);
extern int ResObj_Convert(PyObject *, Handle *);
extern PyObject *WinObj_New(WindowPtr);
@@ -1331,6 +1332,19 @@ static PyMethodDef Res_methods[] = {
+/* 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);
+}
+
+
void initRes()
{