Skip to content

Commit e0553d7

Browse files
committed
Fix test_grow_error()
1 parent 169f4c6 commit e0553d7

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

Objects/bytesobject.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3696,6 +3696,10 @@ byteswriter_resize(PyBytesWriter *writer, Py_ssize_t size, int resize)
36963696
if (writer->obj != NULL) {
36973697
if (writer->use_bytearray) {
36983698
if (PyByteArray_Resize(writer->obj, size)) {
3699+
#ifdef Py_DEBUG
3700+
// bytearray can override the canary byte on error
3701+
byteswriter_write_canary_byte(writer);
3702+
#endif
36993703
return -1;
37003704
}
37013705
}

0 commit comments

Comments
 (0)