STINNER Victor added the comment:

> You can't "un-memmove" because you already lost bytes between new_hi and hi.

Oh, that's why I prefered a review. You're right, bytes are lost.

Here is a different approach which updates the size to ensure that the object 
is consistent on memory allocation failure.

----------
Added file: 
http://bugs.python.org/file32603/bytearray_setslice_mem_error-2.patch

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue19568>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to