Skip to content

Commit 00f6a54

Browse files
committed
chore: add comment for bytearray_contains
1 parent f2afe09 commit 00f6a54

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Objects/bytearrayobject.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1376,6 +1376,8 @@ bytearray_contains(PyObject *self, PyObject *arg)
13761376
int ret = -1;
13771377
Py_BEGIN_CRITICAL_SECTION(self);
13781378
PyByteArrayObject *ba = _PyByteArray_CAST(self);
1379+
1380+
/* Increase exports to prevent bytearray storage from changing during _Py_bytes_contains(). */
13791381
ba->ob_exports++;
13801382
ret = _Py_bytes_contains(PyByteArray_AS_STRING(ba),
13811383
PyByteArray_GET_SIZE(self),

0 commit comments

Comments
 (0)