mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00: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:
parent
13870b18f2
commit
de01774dae
1 changed files with 1 additions and 1 deletions
|
@ -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)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue