-
-
Notifications
You must be signed in to change notification settings - Fork 31.8k
gh-105156: Cleanup usage of old Py_UNICODE type #105158
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
* refcounts.dat: * Remove Py_UNICODE functions * Replace Py_UNICODE argument type with wchar_t * _PyUnicode_ToLowercase(), _PyUnicode_ToUppercase(), _PyUnicode_ToTitlecase() are no longer deprecate in comment. 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.
cc @methane |
Tools/gdb/libpython.py
Outdated
|
||
# 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, characters)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
result = u''.join(map(chr, characters)) | |
result = ''.join(map(chr, characters)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removing supporting for Python 2 require way more changes. I prefer to restrict changes to just Py_UNICODE here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI, I removed Python 2 support from libpython.py already.
https://github.com/python/cpython/pull/31717/files
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh I didn't know. Well, feel free to remove that u
prefix in a separated PR :-) My PR doesn't add it at least :-)
Merged. Thanks for your review @methane. |
refcounts.dat:
_PyUnicode_ToLowercase(), _PyUnicode_ToUppercase(), _PyUnicode_ToTitlecase() are no longer deprecate in comment. 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.
📚 Documentation preview 📚: https://cpython-previews--105158.org.readthedocs.build/