gh-105156: Cleanup usage of old Py_UNICODE type#105158
Merged
vstinner merged 2 commits intopython:mainfrom Jun 1, 2023
Merged
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.
Member
Author
|
cc @methane |
vstinner
commented
May 31, 2023
methane
reviewed
May 31, 2023
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)) |
Member
There was a problem hiding this comment.
Suggested change
| result = u''.join(map(chr, characters)) | |
| result = ''.join(map(chr, characters)) |
Member
Author
There was a problem hiding this comment.
Removing supporting for Python 2 require way more changes. I prefer to restrict changes to just Py_UNICODE here.
Member
There was a problem hiding this comment.
FYI, I removed Python 2 support from libpython.py already.
https://github.com/python/cpython/pull/31717/files
Member
Author
There was a problem hiding this comment.
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 :-)
Member
Author
|
Merged. Thanks for your review @methane. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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/