We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 782cab1 commit 14963eaCopy full SHA for 14963ea
Objects/bytearrayobject.c
@@ -1359,12 +1359,15 @@ static int
1359
bytearray_contains(PyObject *self, PyObject *arg)
1360
{
1361
int ret;
1362
+ Py_BEGIN_CRITICAL_SECTION(self);
1363
Py_buffer selfbuf;
1364
if (PyObject_GetBuffer((PyObject *)self, &selfbuf, PyBUF_SIMPLE) != 0) {
1365
+ Py_END_CRITICAL_SECTION();
1366
return -1;
1367
}
1368
ret = _Py_bytes_contains((const char *)selfbuf.buf, selfbuf.len, arg);
1369
PyBuffer_Release(&selfbuf);
1370
1371
return ret;
1372
1373
0 commit comments