Skip to content

Commit 70068b9

Browse files
authored
Fix Unicode doc and replace use of macro with PyMem_New function (GH-94088)
1 parent 03da5d0 commit 70068b9

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Doc/c-api/unicode.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -819,7 +819,7 @@ wchar_t Support
819819
most C functions. If *size* is ``NULL`` and the :c:type:`wchar_t*` string
820820
contains null characters a :exc:`ValueError` is raised.
821821
822-
Returns a buffer allocated by :c:func:`PyMem_Alloc` (use
822+
Returns a buffer allocated by :c:func:`PyMem_New` (use
823823
:c:func:`PyMem_Free` to free it) on success. On error, returns ``NULL``
824824
and *\*size* is undefined. Raises a :exc:`MemoryError` if memory allocation
825825
is failed.

Objects/unicodeobject.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2843,7 +2843,7 @@ PyUnicode_AsWideCharString(PyObject *unicode,
28432843
}
28442844

28452845
buflen = unicode_get_widechar_size(unicode);
2846-
buffer = (wchar_t *) PyMem_NEW(wchar_t, (buflen + 1));
2846+
buffer = (wchar_t *) PyMem_New(wchar_t, (buflen + 1));
28472847
if (buffer == NULL) {
28482848
PyErr_NoMemory();
28492849
return NULL;

0 commit comments

Comments
 (0)