Skip to content
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

gh-94808: Cover %p in PyUnicode_FromFormat #96677

Merged
merged 7 commits into from
Oct 7, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Update Lib/test/test_unicode.py
JelleZijlstra authored Oct 7, 2022

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit cb76e610e39a3ce5fdc0b3f6e46083e7587ced26
2 changes: 1 addition & 1 deletion Lib/test/test_unicode.py
Original file line number Diff line number Diff line change
@@ -2811,7 +2811,7 @@ def check_format(expected, format, *args):
# We cannot test the exact result,
# because it returns a hex representation of a C pointer,
# which is going to be different each time. But, we can test the format.
p_format_regex = r'0x[a-zA-Z0-9]{8,}'
p_format_regex = r'^0x[a-zA-Z0-9]{8,}$'
p_format1 = PyUnicode_FromFormat(b'%p', 'abc')
self.assertIsInstance(p_format1, str)
self.assertRegex(p_format1, p_format_regex)