diff options
author | Georg Brandl <georg@python.org> | 2005-08-26 06:43:16 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2005-08-26 06:43:16 (GMT) |
commit | 66e75ac6e092fd1b5b9a7e9378928c9ec0829f32 (patch) | |
tree | 203bed2e39badf89a4bef7e1a281f81192a8097e /Objects/bufferobject.c | |
parent | a74a655d816399e1168680c20daff3032665450d (diff) | |
download | cpython-66e75ac6e092fd1b5b9a7e9378928c9ec0829f32.zip cpython-66e75ac6e092fd1b5b9a7e9378928c9ec0829f32.tar.gz cpython-66e75ac6e092fd1b5b9a7e9378928c9ec0829f32.tar.bz2 |
Disallow keyword arguments for type constructors that don't use them
(fixes #1119418).
Diffstat (limited to 'Objects/bufferobject.c')
-rw-r--r-- | Objects/bufferobject.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Objects/bufferobject.c b/Objects/bufferobject.c index 674d2b5..da8d9fc 100644 --- a/Objects/bufferobject.c +++ b/Objects/bufferobject.c @@ -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); } |