diff options
author | Victor Stinner <victor.stinner@haypocalc.com> | 2011-10-03 13:53:37 +0200 |
---|---|---|
committer | Victor Stinner <victor.stinner@haypocalc.com> | 2011-10-03 13:53:37 +0200 |
commit | 7e233deecbd59f88082f6fb7dad7b851236b4354 (patch) | |
tree | ee789c331710636bd54546964e9bfa3890323968 /Tools/gdb/libpython.py | |
parent | 3333b864e0a076b352f2851971df3d29be01850a (diff) | |
download | cpython-7e233deecbd59f88082f6fb7dad7b851236b4354.tar.gz |
PyUnicode_Ready() now sets ascii=1 if maxchar < 128
ascii=1 is no more reserved to PyASCIIObject. Use
PyUnicode_IS_COMPACT_ASCII(obj) to check if obj is a PyASCIIObject (as before).
Diffstat (limited to 'Tools/gdb/libpython.py')
-rw-r--r-- | Tools/gdb/libpython.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Tools/gdb/libpython.py b/Tools/gdb/libpython.py index b5183d45fc..4b42c8bff8 100644 --- a/Tools/gdb/libpython.py +++ b/Tools/gdb/libpython.py @@ -1132,15 +1132,16 @@ class PyUnicodeObjectPtr(PyObjectPtr): compact = self.field('_base') ascii = compact['_base'] state = ascii['state'] + is_compact_ascii = (int(state['ascii']) and int(state['compact'])) field_length = long(ascii['length']) if not int(state['ready']): # string is not ready may_have_surrogates = True field_str = ascii['wstr'] - if not int(state['ascii']): + if not is_compact_ascii: field_length = compact('wstr_length') else: - if int(state['ascii']): + if is_compact_ascii: field_str = ascii.address + 1 elif int(state['compact']): field_str = compact.address + 1 |