mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Disallow keyword arguments for type constructors that don't use them.
(fixes bug #1119418)
This commit is contained in:
parent
bd77da6dab
commit
02c42871cf
13 changed files with 100 additions and 13 deletions
|
@ -935,6 +935,9 @@ frozenset_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
|
|||
{
|
||||
PyObject *iterable = NULL, *result;
|
||||
|
||||
if (!_PyArg_NoKeywords("frozenset()", kwds))
|
||||
return NULL;
|
||||
|
||||
if (!PyArg_UnpackTuple(args, type->tp_name, 0, 1, &iterable))
|
||||
return NULL;
|
||||
|
||||
|
@ -976,6 +979,9 @@ PySet_Fini(void)
|
|||
static PyObject *
|
||||
set_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
|
||||
{
|
||||
if (!_PyArg_NoKeywords("set()", kwds))
|
||||
return NULL;
|
||||
|
||||
return make_new_set(type, NULL);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue