mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +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
|
@ -192,7 +192,10 @@ buffer_new(PyTypeObject *type, PyObject *args, PyObject *kw)
|
|||
int offset = 0;
|
||||
int size = Py_END_OF_BUFFER;
|
||||
|
||||
if ( !PyArg_ParseTuple(args, "O|ii:buffer", &ob, &offset, &size) )
|
||||
if (!_PyArg_NoKeywords("buffer()", kw))
|
||||
return NULL;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "O|ii:buffer", &ob, &offset, &size))
|
||||
return NULL;
|
||||
return PyBuffer_FromObject(ob, offset, size);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue