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 @@ -1359,14 +1359,13 @@ static int
13591359bytearray_contains (PyObject * self , PyObject * arg )
13601360{
13611361 int ret ;
1362- Py_BEGIN_CRITICAL_SECTION (self );
13631362 Py_buffer selfbuf ;
1364- if (PyObject_GetBuffer ((PyObject * )self , & selfbuf , PyBUF_SIMPLE ) != 0 ) {
1365- Py_END_CRITICAL_SECTION ();
1366- return -1 ;
1363+ Py_BEGIN_CRITICAL_SECTION (self );
1364+ ret = -1 ;
1365+ if (PyObject_GetBuffer ((PyObject * )self , & selfbuf , PyBUF_SIMPLE ) == 0 ) {
1366+ ret = _Py_bytes_contains ((const char * )selfbuf .buf , selfbuf .len , arg );
1367+ PyBuffer_Release (& selfbuf );
13671368 }
1368- ret = _Py_bytes_contains ((const char * )selfbuf .buf , selfbuf .len , arg );
1369- PyBuffer_Release (& selfbuf );
13701369 Py_END_CRITICAL_SECTION ();
13711370 return ret ;
13721371}
You can’t perform that action at this time.
0 commit comments