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

use bytes.hex/bytes.fromhex instead of binascii #2119

Open
williballenthin opened this issue Jun 4, 2024 · 0 comments
Open

use bytes.hex/bytes.fromhex instead of binascii #2119

williballenthin opened this issue Jun 4, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers gsoc Work related to Google Summer of Code project.

Comments

@williballenthin
Copy link
Collaborator

Unrelated to this PR, I think we can replace

b = codecs.decode(s.replace(" ", "").encode("ascii"), "hex")

with:

b = bytes.fromhex(s)

https://docs.python.org/3/library/stdtypes.html#bytes.fromhex

Originally posted by @s-ff in #2080 (review)

@williballenthin williballenthin added enhancement New feature or request good first issue Good for newcomers gsoc Work related to Google Summer of Code project. labels Jun 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers gsoc Work related to Google Summer of Code project.
Projects
None yet
Development

No branches or pull requests

2 participants