Fix gdb/libpython.py for not ready Unicode strings

_PyUnicode_CheckConsistency() checks also hash and length value for not ready
Unicode strings.
This commit is contained in:
Victor Stinner 2011-11-04 20:54:05 +01:00
parent 2fc507fe45
commit e30c0a1014
3 changed files with 10 additions and 10 deletions

View file

@ -1123,9 +1123,6 @@ class PyUnicodeObjectPtr(PyObjectPtr):
return _type_Py_UNICODE.sizeof
def proxyval(self, visited):
# From unicodeobject.h:
# Py_ssize_t length; /* Length of raw Unicode data in buffer */
# Py_UNICODE *str; /* Raw Unicode buffer */
if _is_pep393:
# Python 3.3 and newer
may_have_surrogates = False
@ -1138,8 +1135,6 @@ class PyUnicodeObjectPtr(PyObjectPtr):
# string is not ready
may_have_surrogates = True
field_str = ascii['wstr']
if not is_compact_ascii:
field_length = compact('wstr_length')
else:
if is_compact_ascii:
field_str = ascii.address + 1