Skip to content

Commit be06c26

Browse files
committed
chore: add comment for split and rsplit
1 parent 00f6a54 commit be06c26

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
@@ -1802,6 +1802,7 @@ bytearray_split_impl(PyByteArrayObject *self, PyObject *sep,
18021802
PyObject *list = NULL;
18031803
_Py_CRITICAL_SECTION_ASSERT_OBJECT_LOCKED((PyObject *)self);
18041804

1805+
/* Increase exports to prevent bytearray storage from changing during _Py_bytes_contains(). */
18051806
self->ob_exports++;
18061807
const char *sbuf = PyByteArray_AS_STRING(self);
18071808
Py_ssize_t slen = PyByteArray_GET_SIZE((PyObject *)self);
@@ -1926,6 +1927,7 @@ bytearray_rsplit_impl(PyByteArrayObject *self, PyObject *sep,
19261927
PyObject *list = NULL;
19271928
_Py_CRITICAL_SECTION_ASSERT_OBJECT_LOCKED((PyObject *)self);
19281929

1930+
/* Increase exports to prevent bytearray storage from changing during _Py_bytes_contains(). */
19291931
self->ob_exports++;
19301932
const char *sbuf = PyByteArray_AS_STRING(self);
19311933
Py_ssize_t slen = PyByteArray_GET_SIZE((PyObject *)self);

0 commit comments

Comments
 (0)