summaryrefslogtreecommitdiffstats
path: root/Mac
diff options
context:
space:
mode:
Diffstat (limited to 'Mac')
-rw-r--r--Mac/Modules/dlg/_Dlgmodule.c2
-rw-r--r--Mac/Modules/dlg/dlgsupport.py2
-rw-r--r--Mac/Modules/file/_Filemodule.c2
-rw-r--r--Mac/Modules/file/filesupport.py2
-rw-r--r--Mac/Modules/gestaltmodule.c4
5 files changed, 6 insertions, 6 deletions
diff --git a/Mac/Modules/dlg/_Dlgmodule.c b/Mac/Modules/dlg/_Dlgmodule.c
index 64ddac8..46009a8 100644
--- a/Mac/Modules/dlg/_Dlgmodule.c
+++ b/Mac/Modules/dlg/_Dlgmodule.c
@@ -139,7 +139,7 @@ typedef struct DialogObject {
PyObject *DlgObj_New(DialogPtr itself)
{
DialogObject *it;
- if (itself == NULL) return Py_None;
+ if (itself == NULL) { Py_INCREF(Py_None); return Py_None; }
it = PyObject_NEW(DialogObject, &Dialog_Type);
if (it == NULL) return NULL;
it->ob_itself = itself;
diff --git a/Mac/Modules/dlg/dlgsupport.py b/Mac/Modules/dlg/dlgsupport.py
index 1c0cc6a..fa1442e 100644
--- a/Mac/Modules/dlg/dlgsupport.py
+++ b/Mac/Modules/dlg/dlgsupport.py
@@ -202,7 +202,7 @@ class MyObjectDefinition(PEP253Mixin, GlobalObjectDefinition):
Output("SetWRefCon(GetDialogWindow(itself), (long)it);")
def outputCheckNewArg(self):
- Output("if (itself == NULL) return Py_None;")
+ Output("if (itself == NULL) { Py_INCREF(Py_None); return Py_None; }")
def outputCheckConvertArg(self):
Output("if (v == Py_None) { *p_itself = NULL; return 1; }")
diff --git a/Mac/Modules/file/_Filemodule.c b/Mac/Modules/file/_Filemodule.c
index c211de1..07bd341 100644
--- a/Mac/Modules/file/_Filemodule.c
+++ b/Mac/Modules/file/_Filemodule.c
@@ -153,7 +153,7 @@ typedef struct FSCatalogInfoObject {
static PyObject *FSCatalogInfo_New(FSCatalogInfo *itself)
{
FSCatalogInfoObject *it;
- if (itself == NULL) return Py_None;
+ if (itself == NULL) { Py_INCREF(Py_None); return Py_None; }
it = PyObject_NEW(FSCatalogInfoObject, &FSCatalogInfo_Type);
if (it == NULL) return NULL;
it->ob_itself = *itself;
diff --git a/Mac/Modules/file/filesupport.py b/Mac/Modules/file/filesupport.py
index f2d4193..37aeb50 100644
--- a/Mac/Modules/file/filesupport.py
+++ b/Mac/Modules/file/filesupport.py
@@ -475,7 +475,7 @@ class FSCatalogInfoDefinition(PEP253Mixin, ObjectDefinition):
self.argref = "*" # Store FSSpecs, but pass them by address
def outputCheckNewArg(self):
- Output("if (itself == NULL) return Py_None;")
+ Output("if (itself == NULL) { Py_INCREF(Py_None); return Py_None; }")
def output_tp_newBody(self):
Output("PyObject *self;");
diff --git a/Mac/Modules/gestaltmodule.c b/Mac/Modules/gestaltmodule.c
index 6d8673f..ddfa94a 100644
--- a/Mac/Modules/gestaltmodule.c
+++ b/Mac/Modules/gestaltmodule.c
@@ -35,7 +35,7 @@ gestalt_gestalt(PyObject *self, PyObject *args)
OSErr iErr;
OSType selector;
long response;
- if (!PyArg_Parse(args, "O&", PyMac_GetOSType, &selector))
+ if (!PyArg_ParseTuple(args, "O&", PyMac_GetOSType, &selector))
return NULL;
iErr = Gestalt ( selector, &response );
if (iErr != 0)
@@ -44,7 +44,7 @@ gestalt_gestalt(PyObject *self, PyObject *args)
}
static struct PyMethodDef gestalt_methods[] = {
- {"gestalt", gestalt_gestalt},
+ {"gestalt", gestalt_gestalt, METH_VARARGS},
{NULL, NULL} /* Sentinel */
};