Skip to content

Commit 04407be

Browse files
authored
Update secrets from 3.13.5 (#5991)
1 parent a0a6f73 commit 04407be

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

Lib/secrets.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
managing secrets such as account authentication, tokens, and similar.
33
44
See PEP 506 for more information.
5-
https://www.python.org/dev/peps/pep-0506/
5+
https://peps.python.org/pep-0506/
66
77
"""
88

@@ -13,7 +13,6 @@
1313

1414

1515
import base64
16-
import binascii
1716

1817
from hmac import compare_digest
1918
from random import SystemRandom
@@ -56,7 +55,7 @@ def token_hex(nbytes=None):
5655
'f9bf78b9a18ce6d46a0cd2b0b86df9da'
5756
5857
"""
59-
return binascii.hexlify(token_bytes(nbytes)).decode('ascii')
58+
return token_bytes(nbytes).hex()
6059

6160
def token_urlsafe(nbytes=None):
6261
"""Return a random URL-safe text string, in Base64 encoding.

0 commit comments

Comments
 (0)