mirror of
https://github.com/python/cpython.git
synced 2025-07-15 23:35:23 +00:00
PyUnicode_Format(): disable overallocation when we are writing the last part
of the output string
This commit is contained in:
parent
afffce489b
commit
a049443fab
1 changed files with 3 additions and 1 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue