Commit a10cc7ea authored by Jack Jansen's avatar Jack Jansen

Treat an empty kwdict argument the same as a missing one.

parent 5fcafdf5
...@@ -437,8 +437,8 @@ nav_NavGetFile(self, args, kw) ...@@ -437,8 +437,8 @@ nav_NavGetFile(self, args, kw)
NavTypeListHandle typeList = NULL; NavTypeListHandle typeList = NULL;
OSErr err; OSErr err;
if ( kw ) { if ( kw && PyObject_IsTrue(kw) ) {
if (!PyArg_ParseTuple(args, "")) if (!PyArg_ParseTuple(args, ";either keyword arguments or dictionary expected"))
return NULL; return NULL;
dict = kw; dict = kw;
} else if (!PyArg_ParseTuple(args, "O!", &PyDict_Type, &dict)) } else if (!PyArg_ParseTuple(args, "O!", &PyDict_Type, &dict))
...@@ -474,8 +474,8 @@ nav_NavPutFile(self, args, kw) ...@@ -474,8 +474,8 @@ nav_NavPutFile(self, args, kw)
OSType fileCreator; OSType fileCreator;
OSErr err; OSErr err;
if ( kw ) { if ( kw && PyObject_IsTrue(kw) ) {
if (!PyArg_ParseTuple(args, "")) if (!PyArg_ParseTuple(args, ";either keyword arguments or dictionary expected"))
return NULL; return NULL;
dict = kw; dict = kw;
} else if (!PyArg_ParseTuple(args, "O!", &PyDict_Type, &dict)) } else if (!PyArg_ParseTuple(args, "O!", &PyDict_Type, &dict))
...@@ -510,7 +510,7 @@ nav_NavAskSaveChanges(self, args, kw) ...@@ -510,7 +510,7 @@ nav_NavAskSaveChanges(self, args, kw)
NavEventUPP eventProc = NULL; NavEventUPP eventProc = NULL;
OSErr err; OSErr err;
if ( kw ) { if ( kw && PyObject_IsTrue(kw) ) {
if (!PyArg_ParseTuple(args, "l", &action)) if (!PyArg_ParseTuple(args, "l", &action))
return NULL; return NULL;
dict = kw; dict = kw;
...@@ -542,8 +542,8 @@ nav_NavCustomAskSaveChanges(self, args, kw) ...@@ -542,8 +542,8 @@ nav_NavCustomAskSaveChanges(self, args, kw)
NavEventUPP eventProc = NULL; NavEventUPP eventProc = NULL;
OSErr err; OSErr err;
if ( kw ) { if ( kw && PyObject_IsTrue(kw) ) {
if (!PyArg_ParseTuple(args, "")) if (!PyArg_ParseTuple(args, ";either keyword arguments or dictionary expected"))
return NULL; return NULL;
dict = kw; dict = kw;
} else if (!PyArg_ParseTuple(args, "O!", &PyDict_Type, &dict)) } else if (!PyArg_ParseTuple(args, "O!", &PyDict_Type, &dict))
...@@ -574,8 +574,8 @@ nav_NavAskDiscardChanges(self, args, kw) ...@@ -574,8 +574,8 @@ nav_NavAskDiscardChanges(self, args, kw)
NavEventUPP eventProc = NULL; NavEventUPP eventProc = NULL;
OSErr err; OSErr err;
if ( kw ) { if ( kw && PyObject_IsTrue(kw) ) {
if (!PyArg_ParseTuple(args, "")) if (!PyArg_ParseTuple(args, ";either keyword arguments or dictionary expected"))
return NULL; return NULL;
dict = kw; dict = kw;
} else if (!PyArg_ParseTuple(args, "O!", &PyDict_Type, &dict)) } else if (!PyArg_ParseTuple(args, "O!", &PyDict_Type, &dict))
...@@ -610,8 +610,8 @@ nav_NavChooseFile(self, args, kw) ...@@ -610,8 +610,8 @@ nav_NavChooseFile(self, args, kw)
NavTypeListHandle typeList = NULL; NavTypeListHandle typeList = NULL;
OSErr err; OSErr err;
if ( kw ) { if ( kw && PyObject_IsTrue(kw) ) {
if (!PyArg_ParseTuple(args, "")) if (!PyArg_ParseTuple(args, ";either keyword arguments or dictionary expected"))
return NULL; return NULL;
dict = kw; dict = kw;
} else if (!PyArg_ParseTuple(args, "O!", &PyDict_Type, &dict)) } else if (!PyArg_ParseTuple(args, "O!", &PyDict_Type, &dict))
...@@ -646,8 +646,8 @@ nav_NavChooseFolder(self, args, kw) ...@@ -646,8 +646,8 @@ nav_NavChooseFolder(self, args, kw)
NavObjectFilterUPP filterProc = NULL; NavObjectFilterUPP filterProc = NULL;
OSErr err; OSErr err;
if ( kw ) { if ( kw && PyObject_IsTrue(kw) ) {
if (!PyArg_ParseTuple(args, "")) if (!PyArg_ParseTuple(args, ";either keyword arguments or dictionary expected"))
return NULL; return NULL;
dict = kw; dict = kw;
} else if (!PyArg_ParseTuple(args, "O!", &PyDict_Type, &dict)) } else if (!PyArg_ParseTuple(args, "O!", &PyDict_Type, &dict))
...@@ -682,8 +682,8 @@ nav_NavChooseVolume(self, args, kw) ...@@ -682,8 +682,8 @@ nav_NavChooseVolume(self, args, kw)
NavObjectFilterUPP filterProc = NULL; NavObjectFilterUPP filterProc = NULL;
OSErr err; OSErr err;
if ( kw ) { if ( kw && PyObject_IsTrue(kw) ) {
if (!PyArg_ParseTuple(args, "")) if (!PyArg_ParseTuple(args, ";either keyword arguments or dictionary expected"))
return NULL; return NULL;
dict = kw; dict = kw;
} else if (!PyArg_ParseTuple(args, "O!", &PyDict_Type, &dict)) } else if (!PyArg_ParseTuple(args, "O!", &PyDict_Type, &dict))
...@@ -718,8 +718,8 @@ nav_NavChooseObject(self, args, kw) ...@@ -718,8 +718,8 @@ nav_NavChooseObject(self, args, kw)
NavObjectFilterUPP filterProc = NULL; NavObjectFilterUPP filterProc = NULL;
OSErr err; OSErr err;
if ( kw ) { if ( kw && PyObject_IsTrue(kw) ) {
if (!PyArg_ParseTuple(args, "")) if (!PyArg_ParseTuple(args, ";either keyword arguments or dictionary expected"))
return NULL; return NULL;
dict = kw; dict = kw;
} else if (!PyArg_ParseTuple(args, "O!", &PyDict_Type, &dict)) } else if (!PyArg_ParseTuple(args, "O!", &PyDict_Type, &dict))
...@@ -753,8 +753,8 @@ nav_NavNewFolder(self, args, kw) ...@@ -753,8 +753,8 @@ nav_NavNewFolder(self, args, kw)
NavEventUPP eventProc = NULL; NavEventUPP eventProc = NULL;
OSErr err; OSErr err;
if ( kw ) { if ( kw && PyObject_IsTrue(kw) ) {
if (!PyArg_ParseTuple(args, "")) if (!PyArg_ParseTuple(args, ";either keyword arguments or dictionary expected"))
return NULL; return NULL;
dict = kw; dict = kw;
} else if (!PyArg_ParseTuple(args, "O!", &PyDict_Type, &dict)) } else if (!PyArg_ParseTuple(args, "O!", &PyDict_Type, &dict))
...@@ -771,7 +771,7 @@ nav_NavNewFolder(self, args, kw) ...@@ -771,7 +771,7 @@ nav_NavNewFolder(self, args, kw)
} }
#if 0 #if 0
XXXX I don't know what to do with the void * argument /* XXXX I don't know what to do with the void * argument */
static char nav_NavCustomControl__doc__[] = static char nav_NavCustomControl__doc__[] =
"" ""
; ;
......
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