Skip to content

Commit 13abb41

Browse files
committed
Just use the C API... Sorry for the onoise...
1 parent a1daaae commit 13abb41

1 file changed

Lines changed: 1 addition & 9 deletions

File tree

Modules/_io/iobase.c

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -948,15 +948,7 @@ _io__RawIOBase_read_impl(PyObject *self, Py_ssize_t n)
948948
bytes_filled, n);
949949
goto cleanup;
950950
}
951-
952-
res = PyObject_CallMethod(b, "resize", "n", bytes_filled);
953-
if (res != Py_None) {
954-
if (res != NULL) {
955-
PyErr_Format(PyExc_ValueError,
956-
"resize returned unexpected value %R",
957-
res);
958-
Py_CLEAR(res);
959-
}
951+
if (PyByteArray_Resize(b, bytes_filled) < 0) {
960952
goto cleanup;
961953
}
962954
res = PyObject_CallMethod(b, "take_bytes", NULL);

0 commit comments

Comments
 (0)