Skip to content

Commit d36b4aa

Browse files
committed
lock second operand in bytearray_iconcat as well
1 parent 3c62f81 commit d36b4aa

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Fix two more :class:`bytearray` functions for :term:`free-threading`.
1+
Fix two more :class:`bytearray` functions for :term:`free threading`.

Objects/bytearrayobject.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,7 @@ static PyObject *
329329
bytearray_iconcat_lock_held(PyObject *op, PyObject *other)
330330
{
331331
_Py_CRITICAL_SECTION_ASSERT_OBJECT_LOCKED(op);
332+
_Py_CRITICAL_SECTION_ASSERT_OBJECT_LOCKED(other);
332333
PyByteArrayObject *self = _PyByteArray_CAST(op);
333334

334335
Py_buffer vo;
@@ -358,9 +359,9 @@ static PyObject *
358359
bytearray_iconcat(PyObject *op, PyObject *other)
359360
{
360361
PyObject *ret;
361-
Py_BEGIN_CRITICAL_SECTION(op);
362+
Py_BEGIN_CRITICAL_SECTION2(op, other);
362363
ret = bytearray_iconcat_lock_held(op, other);
363-
Py_END_CRITICAL_SECTION();
364+
Py_END_CRITICAL_SECTION2();
364365
return ret;
365366
}
366367

0 commit comments

Comments
 (0)