File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -921,7 +921,7 @@ static PyObject *
921921_io__RawIOBase_read_impl (PyObject * self , Py_ssize_t n )
922922/*[clinic end generated code: output=6cdeb731e3c9f13c input=b6d0dcf6417d1374]*/
923923{
924- PyObject * b , * res ;
924+ PyObject * b , * res , * mv ;
925925
926926 if (n < 0 ) {
927927 return PyObject_CallMethodNoArgs (self , & _Py_ID (readall ));
@@ -931,7 +931,7 @@ _io__RawIOBase_read_impl(PyObject *self, Py_ssize_t n)
931931 if (b == NULL )
932932 return NULL ;
933933
934- PyObject * mv = PyMemoryView_FromMemory (PyBytes_AS_STRING (b ), n , PyBUF_WRITE );
934+ mv = PyMemoryView_FromMemory (PyBytes_AS_STRING (b ), n , PyBUF_WRITE );
935935 if (mv == NULL ) {
936936 Py_DECREF (b );
937937 return NULL ;
@@ -952,11 +952,9 @@ _io__RawIOBase_read_impl(PyObject *self, Py_ssize_t n)
952952 return NULL ;
953953 }
954954
955- if (n != PyBytes_GET_SIZE (b )) {
956- if (_PyBytes_Resize (& b , n ) < 0 ) {
957- Py_DECREF (b );
958- return NULL ;
959- }
955+ if (_PyBytes_Resize (& b , n ) < 0 ) {
956+ Py_DECREF (b );
957+ return NULL ;
960958 }
961959
962960 return b ;
You can’t perform that action at this time.
0 commit comments