Use int 0 as default defval for LCID if nothing has been supplied.

This commit is contained in:
Thomas Heller 2006-03-16 19:56:24 +00:00
parent b2167614f8
commit aa47570bdf

View file

@ -2840,9 +2840,14 @@ _build_callargs(CFuncPtrObject *self, PyObject *argtypes,
switch (flag & (PARAMFLAG_FIN | PARAMFLAG_FOUT | PARAMFLAG_FLCID)) { switch (flag & (PARAMFLAG_FIN | PARAMFLAG_FOUT | PARAMFLAG_FLCID)) {
case PARAMFLAG_FIN | PARAMFLAG_FLCID: case PARAMFLAG_FIN | PARAMFLAG_FLCID:
/* ['in', 'lcid'] parameter. Always taken from defval */ /* ['in', 'lcid'] parameter. Always taken from defval,
assert(defval); if given, else the integer 0. */
Py_INCREF(defval); if (defval == NULL) {
defval = PyInt_FromLong(0);
if (defval == NULL)
goto error;
} else
Py_INCREF(defval);
PyTuple_SET_ITEM(callargs, i, defval); PyTuple_SET_ITEM(callargs, i, defval);
break; break;
case (PARAMFLAG_FIN | PARAMFLAG_FOUT): case (PARAMFLAG_FIN | PARAMFLAG_FOUT):