diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2009-10-24 12:28:22 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2009-10-24 12:28:22 (GMT) |
commit | f7820c162648b7b724d0195541896a64ac5df294 (patch) | |
tree | 1b3f7ed20e6521733d3af68d8aed54e73e7d25d6 /Modules/_io | |
parent | fa94e80f3b2c88d4cdcc809c8e1931e289373e84 (diff) | |
download | cpython-f7820c162648b7b724d0195541896a64ac5df294.zip cpython-f7820c162648b7b724d0195541896a64ac5df294.tar.gz cpython-f7820c162648b7b724d0195541896a64ac5df294.tar.bz2 |
Manual py3k backport: [svn r74316] Issue #5449: Fix io.BytesIO to not accept arbitrary keywords
Diffstat (limited to 'Modules/_io')
-rw-r--r-- | Modules/_io/bytesio.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Modules/_io/bytesio.c b/Modules/_io/bytesio.c index beba11c..d25cb67 100644 --- a/Modules/_io/bytesio.c +++ b/Modules/_io/bytesio.c @@ -766,9 +766,11 @@ bytesio_new(PyTypeObject *type, PyObject *args, PyObject *kwds) static int bytesio_init(bytesio *self, PyObject *args, PyObject *kwds) { + char *kwlist[] = {"initial_bytes", NULL}; PyObject *initvalue = NULL; - if (!PyArg_ParseTuple(args, "|O:BytesIO", &initvalue)) + if (!PyArg_ParseTupleAndKeywords(args, kwds, "|O:BytesIO", kwlist, + &initvalue)) return -1; /* In case, __init__ is called multiple times. */ |