mirror of
https://github.com/python/cpython.git
synced 2025-11-02 03:01:58 +00:00
Remove native popen() and fdopen(), replacing them with subprocess calls.
Fix a path to an assert in fileio_read(). Some misc tweaks.
This commit is contained in:
parent
d8595fe304
commit
c2f93dc2e4
7 changed files with 59 additions and 1552 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue