Skip to content

Commit f5ea967

Browse files
committed
Comments/blurb spelling and grammar
1 parent 98888e0 commit f5ea967

3 files changed

Lines changed: 9 additions & 9 deletions

File tree

Lib/test/test_bytes.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2202,9 +2202,9 @@ class ByteArrayInitialization1Test(unittest.TestCase):
22022202
# A bytearray created with __new__ so that __init__ is never called
22032203
# (often as a side-effect of a subclass not calling super().__init__).
22042204
# Is left with ob_bytes_object == NULL. It's easy for implementation
2205-
# code to not realise that ob_bytes_object can be NULL, so these tests
2205+
# code to not realize that ob_bytes_object can be NULL, so these tests
22062206
# verify a set of code paths that have historically crashed or asserted
2207-
# (see gh-153419)
2207+
# (see gh-153419).
22082208

22092209
def _check(self, stmt, expected):
22102210
code = textwrap.dedent(f"""
@@ -2244,7 +2244,7 @@ def test_init_bytes(self):
22442244

22452245
def test_reinit_length1(self):
22462246
# There is a shortcut taken when resizing, where alloc/2 < newsize.
2247-
# In this case, the existing buffer is reused, rather than reset
2247+
# In this case, the existing buffer is reused, rather than reset.
22482248
# If this happens when newsize == 0 and alloc == 1, then various
22492249
# code assumptions can be violated. This test should catch those
22502250
# in debug builds. (see gh-153419)
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Fix several ``bytearray`` crashes caused by calling or not calling __init__
2-
at the expected times. As a side-effect, calling __init__ on an empty
3-
bytearray that has an active buffer view (``memoryview`` or similar) will
4-
now raise a ``BufferError``
1+
Fix several ``bytearray`` crashes caused by calling, or not calling,
2+
``__init__`` when expected. As a side-effect, calling ``__init__`` on
3+
an empty ``bytearray`` that has an active buffer view (``memoryview`` or
4+
similar) now raises a ``BufferError``.

Objects/bytearrayobject.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1622,8 +1622,8 @@ bytearray_take_bytes_impl(PyByteArrayObject *self, PyObject *n)
16221622
}
16231623

16241624
if (_PyBytes_Resize(&self->ob_bytes_object, to_take) == -1) {
1625-
/* _PyBytes_Resize has made ob_bytes_object NULL here
1626-
we need to ensure that the other byte array fields are consistent. */
1625+
/* _PyBytes_Resize has made ob_bytes_object NULL here. We need to
1626+
ensure that the other bytearray fields are consistent. */
16271627
self->ob_bytes_object = Py_GetConstant(Py_CONSTANT_EMPTY_BYTES);
16281628
bytearray_reinit_from_bytes(self, 0, 0);
16291629
Py_DECREF(remaining);

0 commit comments

Comments
 (0)