File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed
Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -1374,14 +1374,13 @@ static int
13741374bytearray_contains (PyObject * self , PyObject * arg )
13751375{
13761376 int ret ;
1377- Py_BEGIN_CRITICAL_SECTION (self );
13781377 Py_buffer selfbuf ;
1379- if (PyObject_GetBuffer ((PyObject * )self , & selfbuf , PyBUF_SIMPLE ) != 0 ) {
1380- Py_END_CRITICAL_SECTION ();
1381- return -1 ;
1378+ Py_BEGIN_CRITICAL_SECTION (self );
1379+ ret = -1 ;
1380+ if (PyObject_GetBuffer ((PyObject * )self , & selfbuf , PyBUF_SIMPLE ) == 0 ) {
1381+ ret = _Py_bytes_contains ((const char * )selfbuf .buf , selfbuf .len , arg );
1382+ PyBuffer_Release (& selfbuf );
13821383 }
1383- ret = _Py_bytes_contains ((const char * )selfbuf .buf , selfbuf .len , arg );
1384- PyBuffer_Release (& selfbuf );
13851384 Py_END_CRITICAL_SECTION ();
13861385 return ret ;
13871386}
You can’t perform that action at this time.
0 commit comments