dict_has_key(): Accept only one parameter. PR#210 reported by
Andreas Jung <ajung@sz-sb.de>.
This commit is contained in:
parent
0baf773c44
commit
52fccfda5b
|
@ -959,7 +959,7 @@ dict_has_key(mp, args)
|
||||||
PyObject *key;
|
PyObject *key;
|
||||||
long hash;
|
long hash;
|
||||||
register long ok;
|
register long ok;
|
||||||
if (!PyArg_Parse(args, "O", &key))
|
if (!PyArg_ParseTuple(args, "O:has_key", &key))
|
||||||
return NULL;
|
return NULL;
|
||||||
#ifdef CACHE_HASH
|
#ifdef CACHE_HASH
|
||||||
if (!PyString_Check(key) ||
|
if (!PyString_Check(key) ||
|
||||||
|
@ -984,7 +984,7 @@ dict_get(mp, args)
|
||||||
PyObject *val = NULL;
|
PyObject *val = NULL;
|
||||||
long hash;
|
long hash;
|
||||||
|
|
||||||
if (!PyArg_ParseTuple(args, "O|O", &key, &failobj))
|
if (!PyArg_ParseTuple(args, "O|O:get", &key, &failobj))
|
||||||
return NULL;
|
return NULL;
|
||||||
if (mp->ma_table == NULL)
|
if (mp->ma_table == NULL)
|
||||||
goto finally;
|
goto finally;
|
||||||
|
@ -1021,14 +1021,14 @@ dict_clear(mp, args)
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyMethodDef mapp_methods[] = {
|
static PyMethodDef mapp_methods[] = {
|
||||||
{"has_key", (PyCFunction)dict_has_key},
|
{"has_key", (PyCFunction)dict_has_key, METH_VARARGS},
|
||||||
{"keys", (PyCFunction)dict_keys},
|
{"keys", (PyCFunction)dict_keys},
|
||||||
{"items", (PyCFunction)dict_items},
|
{"items", (PyCFunction)dict_items},
|
||||||
{"values", (PyCFunction)dict_values},
|
{"values", (PyCFunction)dict_values},
|
||||||
{"update", (PyCFunction)dict_update},
|
{"update", (PyCFunction)dict_update},
|
||||||
{"clear", (PyCFunction)dict_clear},
|
{"clear", (PyCFunction)dict_clear},
|
||||||
{"copy", (PyCFunction)dict_copy},
|
{"copy", (PyCFunction)dict_copy},
|
||||||
{"get", (PyCFunction)dict_get, 1},
|
{"get", (PyCFunction)dict_get, METH_VARARGS},
|
||||||
{NULL, NULL} /* sentinel */
|
{NULL, NULL} /* sentinel */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue