aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Tools/gdb/libpython.py
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2023-06-01 09:18:09 +0200
committerGitHub <noreply@github.com>2023-06-01 07:18:09 +0000
commit7d07e5891d2843f269fac00dc8847abfe3671765 (patch)
tree0dca70aca596fddbc634dfd870e358dbdb329007 /Tools/gdb/libpython.py
parent424049cc1117d66dfa86196ee5f694c15b46ac6c (diff)
downloadcpython-7d07e5891d2843f269fac00dc8847abfe3671765.tar.gz
cpython-7d07e5891d2843f269fac00dc8847abfe3671765.zip
gh-105156: Cleanup usage of old Py_UNICODE type (#105158)
* refcounts.dat: * Remove Py_UNICODE functions. * Replace Py_UNICODE argument type with wchar_t. * _PyUnicode_ToLowercase(), _PyUnicode_ToUppercase(), _PyUnicode_ToTitlecase() are no longer deprecated in comments. It's no longer needed since they now use Py_UCS4 type, rather than the deprecated Py_UNICODE type. * gdb: Remove unused char_width() method.
Diffstat (limited to 'Tools/gdb/libpython.py')
-rwxr-xr-xTools/gdb/libpython.py10
1 files changed, 3 insertions, 7 deletions
diff --git a/Tools/gdb/libpython.py b/Tools/gdb/libpython.py
index e38bd59e20a..79b8c7527c2 100755
--- a/Tools/gdb/libpython.py
+++ b/Tools/gdb/libpython.py
@@ -1390,10 +1390,6 @@ def _unichr_is_printable(char):
class PyUnicodeObjectPtr(PyObjectPtr):
_typename = 'PyUnicodeObject'
- def char_width(self):
- _type_Py_UNICODE = gdb.lookup_type('Py_UNICODE')
- return _type_Py_UNICODE.sizeof
-
def proxyval(self, visited):
compact = self.field('_base')
ascii = compact['_base']
@@ -1414,13 +1410,13 @@ class PyUnicodeObjectPtr(PyObjectPtr):
elif repr_kind == 4:
field_str = field_str.cast(_type_unsigned_int_ptr())
- # Gather a list of ints from the Py_UNICODE array; these are either
+ # Gather a list of ints from the code point array; these are either
# UCS-1, UCS-2 or UCS-4 code points:
- Py_UNICODEs = [int(field_str[i]) for i in safe_range(field_length)]
+ code_points = [int(field_str[i]) for i in safe_range(field_length)]
# Convert the int code points to unicode characters, and generate a
# local unicode instance.
- result = u''.join(map(chr, Py_UNICODEs))
+ result = u''.join(map(chr, code_points))
return result
def write_repr(self, out, visited):