mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Issue #28992: Use bytes.fromhex().
This commit is contained in:
parent
47bdc40352
commit
8cbd3df3ce
4 changed files with 7 additions and 10 deletions
|
@ -574,7 +574,7 @@ def unquote_to_bytes(string):
|
|||
# if the function is never called
|
||||
global _hextobyte
|
||||
if _hextobyte is None:
|
||||
_hextobyte = {(a + b).encode(): bytes([int(a + b, 16)])
|
||||
_hextobyte = {(a + b).encode(): bytes.fromhex(a + b)
|
||||
for a in _hexdig for b in _hexdig}
|
||||
for item in bits[1:]:
|
||||
try:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue