diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index 6174998e1a9..4c509b4b39f 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -5938,7 +5938,7 @@ PyUnicode_AsUnicodeEscapeString(PyObject *unicode) p = PyBytes_AS_STRING(repr); for (i = 0; i < len; i++) { - Py_UNICODE ch = PyUnicode_READ(kind, data, i); + Py_UCS4 ch = PyUnicode_READ(kind, data, i); /* Escape backslashes */ if (ch == '\\') {