Skip to content

Commit f7583b2

Browse files
committed
chore: bytearray_contains add Py_BEGIN_CRITICAL_SECTION back
1 parent a1d1d66 commit f7583b2

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Objects/bytearrayobject.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1374,12 +1374,15 @@ static int
13741374
bytearray_contains(PyObject *self, PyObject *arg)
13751375
{
13761376
int ret;
1377+
Py_BEGIN_CRITICAL_SECTION(self);
13771378
Py_buffer selfbuf;
13781379
if (PyObject_GetBuffer((PyObject *)self, &selfbuf, PyBUF_SIMPLE) != 0) {
1380+
Py_END_CRITICAL_SECTION();
13791381
return -1;
13801382
}
13811383
ret = _Py_bytes_contains((const char *)selfbuf.buf, selfbuf.len, arg);
13821384
PyBuffer_Release(&selfbuf);
1385+
Py_END_CRITICAL_SECTION();
13831386
return ret;
13841387
}
13851388

0 commit comments

Comments
 (0)