diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2016-01-27 16:01:13 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2016-01-27 16:01:13 (GMT) |
commit | 5b96f17b1c30b14bd1c017504e7b6df17e1ad961 (patch) | |
tree | add470bd488cb777fab2a1760f7a4d59af1a354d /Objects/unicodeobject.c | |
parent | 0ef0423cb2af178022991e9f3bfc276a2c3e1358 (diff) | |
parent | 5bc03a6d4d5d08663056ad1e85b67ad53e74d795 (diff) | |
download | cpython-5b96f17b1c30b14bd1c017504e7b6df17e1ad961.zip cpython-5b96f17b1c30b14bd1c017504e7b6df17e1ad961.tar.gz cpython-5b96f17b1c30b14bd1c017504e7b6df17e1ad961.tar.bz2 |
Merge 3.5
Diffstat (limited to 'Objects/unicodeobject.c')
-rw-r--r-- | Objects/unicodeobject.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index fb79bd9..ab80e24 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -911,6 +911,8 @@ resize_compact(PyObject *unicode, Py_ssize_t length) else if (_PyUnicode_HAS_WSTR_MEMORY(unicode)) { PyObject_DEL(_PyUnicode_WSTR(unicode)); _PyUnicode_WSTR(unicode) = NULL; + if (!PyUnicode_IS_ASCII(unicode)) + _PyUnicode_WSTR_LENGTH(unicode) = 0; } #ifdef Py_DEBUG unicode_fill_invalid(unicode, old_length); |