Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5b96f17

Browse files
committed
Merge 3.5
2 parents 0ef0423 + 5bc03a6 commit 5b96f17

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

Objects/unicodeobject.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -911,6 +911,8 @@ resize_compact(PyObject *unicode, Py_ssize_t length)
911911
else if (_PyUnicode_HAS_WSTR_MEMORY(unicode)) {
912912
PyObject_DEL(_PyUnicode_WSTR(unicode));
913913
_PyUnicode_WSTR(unicode) = NULL;
914+
if (!PyUnicode_IS_ASCII(unicode))
915+
_PyUnicode_WSTR_LENGTH(unicode) = 0;
914916
}
915917
#ifdef Py_DEBUG
916918
unicode_fill_invalid(unicode, old_length);

0 commit comments

Comments
 (0)