Mercurial > cpython-lru_cache-weakref
diff Objects/setobject.c @ 35450:97c97194e64b 2.4
Disallow keyword arguments for type constructors that don't use them
(fixes #1119418).
| author | Georg Brandl <georg@python.org> |
|---|---|
| date | Fri, 26 Aug 2005 06:43:16 +0000 |
| parents | 503c3697578f |
| children |
line wrap: on
line diff
--- a/Objects/setobject.c Thu Aug 25 22:40:21 2005 +0000 +++ b/Objects/setobject.c Fri Aug 26 06:43:16 2005 +0000 @@ -81,6 +81,9 @@ { PyObject *iterable = NULL; + if (!_PyArg_NoKeywords("frozenset()", kwds)) + return NULL; + if (!PyArg_UnpackTuple(args, type->tp_name, 0, 1, &iterable)) return NULL; if (iterable != NULL && PyFrozenSet_CheckExact(iterable)) { @@ -93,6 +96,9 @@ static PyObject * set_new(PyTypeObject *type, PyObject *args, PyObject *kwds) { + if (!_PyArg_NoKeywords("set()", kwds)) + return NULL; + return make_new_set(type, NULL); }
