mirror of
https://github.com/python/cpython.git
synced 2026-05-10 14:41:01 -04:00
Use correct PyArg_Parse format char for Py_ssize_t in unicode.center().
Fixes: >>> u"".center(10) Traceback (most recent call last): File "<stdin>", line 1, in <module> MemoryError on 64-bit systems.
This commit is contained in:
@@ -4853,7 +4853,7 @@ unicode_center(PyUnicodeObject *self, PyObject *args)
|
||||
Py_ssize_t width;
|
||||
Py_UNICODE fillchar = ' ';
|
||||
|
||||
if (!PyArg_ParseTuple(args, "i|O&:center", &width, convert_uc, &fillchar))
|
||||
if (!PyArg_ParseTuple(args, "n|O&:center", &width, convert_uc, &fillchar))
|
||||
return NULL;
|
||||
|
||||
if (self->length >= width && PyUnicode_CheckExact(self)) {
|
||||
|
||||
Reference in New Issue
Block a user