Skip to content

Commit b182597

Browse files
committed
Update byteswriter_resize()
new_size cannot be 0 in practice
1 parent ca9451c commit b182597

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎Objects/bytesobject.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3819,7 +3819,7 @@ byteswriter_check_consistency(PyBytesWriter *writer)
38193819
static inline int
38203820
byteswriter_resize(PyBytesWriter *writer, Py_ssize_t new_size, int resize)
38213821
{
3822-
assert(new_size >= 0);
3822+
assert(new_size >= 1);
38233823

38243824
Py_ssize_t old_allocated = byteswriter_allocated(writer);
38253825
if (new_size <= old_allocated) {

0 commit comments

Comments
 (0)