PyUnicode_Format(): disable overallocation when we are writing the last part
of the output string
This commit is contained in:
parent
afffce489b
commit
a049443fab
|
@ -13583,8 +13583,10 @@ PyUnicode_Format(PyObject *format, PyObject *args)
|
|||
fmtpos++;
|
||||
fmtcnt--;
|
||||
}
|
||||
if (fmtcnt < 0)
|
||||
if (fmtcnt < 0) {
|
||||
fmtpos--;
|
||||
writer.overallocate = 0;
|
||||
}
|
||||
sublen = fmtpos - nonfmtpos;
|
||||
maxchar = _PyUnicode_FindMaxChar(uformat,
|
||||
nonfmtpos, nonfmtpos + sublen);
|
||||
|
|
Loading…
Reference in New Issue