diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2016-12-21 10:59:28 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2016-12-21 10:59:28 (GMT) |
commit | 8cbd3df3ce75699cdc64d0d1bd903af43da43fa0 (patch) | |
tree | e23173f5414db6ab26f925cc1824c2c6890c6723 /Lib/email | |
parent | 47bdc40352b06cc28ed91c988dbd65bb3b298471 (diff) | |
download | cpython-8cbd3df3ce75699cdc64d0d1bd903af43da43fa0.zip cpython-8cbd3df3ce75699cdc64d0d1bd903af43da43fa0.tar.gz cpython-8cbd3df3ce75699cdc64d0d1bd903af43da43fa0.tar.bz2 |
Issue #28992: Use bytes.fromhex().
Diffstat (limited to 'Lib/email')
-rw-r--r-- | Lib/email/_encoded_words.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/email/_encoded_words.py b/Lib/email/_encoded_words.py index 5eaab36..32a1fa2 100644 --- a/Lib/email/_encoded_words.py +++ b/Lib/email/_encoded_words.py @@ -62,7 +62,7 @@ __all__ = ['decode_q', # regex based decoder. _q_byte_subber = functools.partial(re.compile(br'=([a-fA-F0-9]{2})').sub, - lambda m: bytes([int(m.group(1), 16)])) + lambda m: bytes.fromhex(m.group(1))) def decode_q(encoded): encoded = encoded.replace(b'_', b' ') |