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

Skip to content

Commit f16a350

Browse files
author
Victor Stinner
committed
Oops, really fix gdb/libpython.py for not ready Unicode strings
1 parent 9028a10 commit f16a350

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

Tools/gdb/libpython.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1130,12 +1130,13 @@ def proxyval(self, visited):
11301130
ascii = compact['_base']
11311131
state = ascii['state']
11321132
is_compact_ascii = (int(state['ascii']) and int(state['compact']))
1133-
field_length = long(ascii['length'])
11341133
if not int(state['ready']):
11351134
# string is not ready
1135+
field_length = long(compact['wstr_length'])
11361136
may_have_surrogates = True
11371137
field_str = ascii['wstr']
11381138
else:
1139+
field_length = long(ascii['length'])
11391140
if is_compact_ascii:
11401141
field_str = ascii.address + 1
11411142
elif int(state['compact']):

0 commit comments

Comments
 (0)