diff options
author | Victor Stinner <victor.stinner@haypocalc.com> | 2011-10-03 11:53:37 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@haypocalc.com> | 2011-10-03 11:53:37 (GMT) |
commit | a3b334da6dd0477e5bf144934d184bc0b3e3779b (patch) | |
tree | 9f52ceabf86e5c992b45cfa8582cd98e1877031e /Tools/gdb | |
parent | 1b4f9ceca79206770215c9cbb0b2de532dba4aec (diff) | |
download | cpython-a3b334da6dd0477e5bf144934d184bc0b3e3779b.zip cpython-a3b334da6dd0477e5bf144934d184bc0b3e3779b.tar.gz cpython-a3b334da6dd0477e5bf144934d184bc0b3e3779b.tar.bz2 |
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')
-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 b5183d4..4b42c8b 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 |