Skip to content
Merged
Prev Previous commit
Next Next commit
misc changes
  • Loading branch information
tom-pytel committed Feb 14, 2025
commit e08a36bff6d6d9ee0493560b27a657d0cfdbaa5b
4 changes: 2 additions & 2 deletions Lib/test/test_bytes.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import unittest

import test.support
from test import support
from test.support import import_helper
from test.support import threading_helper
from test.support import warnings_helper
Expand Down Expand Up @@ -2189,8 +2190,7 @@ class BytesSubclassTest(SubclassTest, unittest.TestCase):


class FreeThreadingTest(unittest.TestCase):
@unittest.skipUnless(sysconfig.get_config_var('Py_GIL_DISABLED'),
'this test can only possibly fail with GIL disabled')
@unittest.skipUnless(support.Py_GIL_DISABLED, 'this test can only possibly fail with GIL disabled')
@threading_helper.reap_threads
@threading_helper.requires_working_threading()
def test_free_threading_bytearray(self):
Expand Down
2 changes: 2 additions & 0 deletions Objects/bytearrayobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,7 @@ bytearray_setslice_linear(PyByteArrayObject *self,
Py_ssize_t lo, Py_ssize_t hi,
char *bytes, Py_ssize_t bytes_len)
{
_Py_CRITICAL_SECTION_ASSERT_OBJECT_LOCKED(self);
Py_ssize_t avail = hi - lo;
char *buf = PyByteArray_AS_STRING(self);
Py_ssize_t growth = bytes_len - avail;
Expand Down Expand Up @@ -614,6 +615,7 @@ static int
bytearray_setslice(PyByteArrayObject *self, Py_ssize_t lo, Py_ssize_t hi,
PyObject *values)
{
_Py_CRITICAL_SECTION_ASSERT_OBJECT_LOCKED(self);
Py_ssize_t needed;
void *bytes;
Py_buffer vbytes;
Expand Down