Skip to content

Commit 14963ea

Browse files
committed
chore: bytearray_contains add Py_BEGIN_CRITICAL_SECTION back
1 parent 782cab1 commit 14963ea

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
@@ -1359,12 +1359,15 @@ static int
13591359
bytearray_contains(PyObject *self, PyObject *arg)
13601360
{
13611361
int ret;
1362+
Py_BEGIN_CRITICAL_SECTION(self);
13621363
Py_buffer selfbuf;
13631364
if (PyObject_GetBuffer((PyObject *)self, &selfbuf, PyBUF_SIMPLE) != 0) {
1365+
Py_END_CRITICAL_SECTION();
13641366
return -1;
13651367
}
13661368
ret = _Py_bytes_contains((const char *)selfbuf.buf, selfbuf.len, arg);
13671369
PyBuffer_Release(&selfbuf);
1370+
Py_END_CRITICAL_SECTION();
13681371
return ret;
13691372
}
13701373

0 commit comments

Comments
 (0)