diff options
author | Neal Norwitz <nnorwitz@gmail.com> | 2002-04-01 00:09:00 (GMT) |
---|---|---|
committer | Neal Norwitz <nnorwitz@gmail.com> | 2002-04-01 00:09:00 (GMT) |
commit | 62f5a9d6c2e99b688e388d33c226e41174640082 (patch) | |
tree | f1aae8d0036b1b68ad2eb465a3f7fcb6fc4b6c3f /Objects/fileobject.c | |
parent | b955d6c41e80806c8390dba47323ef7fc41f05aa (diff) | |
download | cpython-62f5a9d6c2e99b688e388d33c226e41174640082.zip cpython-62f5a9d6c2e99b688e388d33c226e41174640082.tar.gz cpython-62f5a9d6c2e99b688e388d33c226e41174640082.tar.bz2 |
Convert file.readinto() to stop using METH_OLDARGS & PyArg_Parse.
Add test for file.readinto().
Diffstat (limited to 'Objects/fileobject.c')
-rw-r--r-- | Objects/fileobject.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Objects/fileobject.c b/Objects/fileobject.c index ebe0d29..3179574 100644 --- a/Objects/fileobject.c +++ b/Objects/fileobject.c @@ -686,7 +686,7 @@ file_readinto(PyFileObject *f, PyObject *args) if (f->f_fp == NULL) return err_closed(); - if (!PyArg_Parse(args, "w#", &ptr, &ntodo)) + if (!PyArg_ParseTuple(args, "w#", &ptr, &ntodo)) return NULL; ndone = 0; while (ntodo > 0) { @@ -1462,7 +1462,7 @@ static PyMethodDef file_methods[] = { {"truncate", (PyCFunction)file_truncate, METH_VARARGS, truncate_doc}, #endif {"tell", (PyCFunction)file_tell, METH_NOARGS, tell_doc}, - {"readinto", (PyCFunction)file_readinto, METH_OLDARGS, readinto_doc}, + {"readinto", (PyCFunction)file_readinto, METH_VARARGS, readinto_doc}, {"readlines", (PyCFunction)file_readlines, METH_VARARGS, readlines_doc}, {"xreadlines", (PyCFunction)file_xreadlines, METH_NOARGS, xreadlines_doc}, {"writelines", (PyCFunction)file_writelines, METH_O, writelines_doc}, |