diff options
author | Guido van Rossum <guido@python.org> | 2007-05-24 00:50:02 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2007-05-24 00:50:02 (GMT) |
commit | c2f93dc2e42b48a20578599407b0bb51a6663d09 (patch) | |
tree | a13677daceceb29f55a468cac3874e1a757dccc9 /Modules/_fileio.c | |
parent | d8595fe304c3d9bb15ad59b1db0b71a2b7ab3c54 (diff) | |
download | cpython-c2f93dc2e42b48a20578599407b0bb51a6663d09.zip cpython-c2f93dc2e42b48a20578599407b0bb51a6663d09.tar.gz cpython-c2f93dc2e42b48a20578599407b0bb51a6663d09.tar.bz2 |
Remove native popen() and fdopen(), replacing them with subprocess calls.
Fix a path to an assert in fileio_read().
Some misc tweaks.
Diffstat (limited to 'Modules/_fileio.c')
-rw-r--r-- | Modules/_fileio.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Modules/_fileio.c b/Modules/_fileio.c index 2bda155..c46f17e 100644 --- a/Modules/_fileio.c +++ b/Modules/_fileio.c @@ -375,6 +375,12 @@ fileio_read(PyFileIOObject *self, PyObject *args) if (!PyArg_ParseTuple(args, "i", &size)) return NULL; + if (size < 0) { + PyErr_SetString(PyExc_ValueError, + "negative read count"); + return NULL; + } + bytes = PyBytes_FromStringAndSize(NULL, size); if (bytes == NULL) return NULL; |