Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Objects/bytesobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -819,8 +819,8 @@ _PyBytes_FormatEx(const char *format, Py_ssize_t format_len,
if (v == NULL)
goto error;

if (fmtcnt < 0) {
/* last writer: disable writer overallocation */
if (fmtcnt == 0) {
/* last write: disable writer overallocation */
writer.overallocate = 0;
}

Expand Down Expand Up @@ -1048,7 +1048,7 @@ _PyBytes_FormatEx(const char *format, Py_ssize_t format_len,

/* If overallocation was disabled, ensure that it was the last
write. Otherwise, we missed an optimization */
assert(writer.overallocate || fmtcnt < 0 || use_bytearray);
assert(writer.overallocate || fmtcnt == 0 || use_bytearray);
} /* until end */

if (argidx < arglen && !dict) {
Expand Down