Skip to content

Commit 6430fd5

Browse files
author
Victor Stinner
committed
Fix hex_digit_to_int() prototype: expect Py_UCS4, not Py_UNICODE
1 parent d9c563e commit 6430fd5

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

‎Objects/bytearrayobject.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1147,7 +1147,7 @@ PyDoc_STRVAR(clear__doc__,
11471147
\n\
11481148
Remove all items from B.");
11491149

1150-
static PyObject *
1150+
static PyObject *
11511151
bytearray_clear(PyByteArrayObject *self)
11521152
{
11531153
if (PyByteArray_Resize((PyObject *)self, 0) < 0)
@@ -2629,7 +2629,7 @@ Spaces between two numbers are accepted.\n\
26292629
Example: bytearray.fromhex('B9 01EF') -> bytearray(b'\\xb9\\x01\\xef').");
26302630

26312631
static int
2632-
hex_digit_to_int(Py_UNICODE c)
2632+
hex_digit_to_int(Py_UCS4 c)
26332633
{
26342634
if (c >= 128)
26352635
return -1;

‎Objects/bytesobject.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -593,7 +593,7 @@ PyBytes_Repr(PyObject *obj, int smartquotes)
593593
quote = '"';
594594
if (squotes && quote == '\'')
595595
newsize += squotes;
596-
596+
597597
if (newsize > (PY_SSIZE_T_MAX - sizeof(PyUnicodeObject) - 1)) {
598598
PyErr_SetString(PyExc_OverflowError,
599599
"bytes object is too large to make repr");
@@ -2330,7 +2330,7 @@ Spaces between two numbers are accepted.\n\
23302330
Example: bytes.fromhex('B9 01EF') -> b'\\xb9\\x01\\xef'.");
23312331

23322332
static int
2333-
hex_digit_to_int(Py_UNICODE c)
2333+
hex_digit_to_int(Py_UCS4 c)
23342334
{
23352335
if (c >= 128)
23362336
return -1;

0 commit comments

Comments
 (0)