Skip to content
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
Next Next commit
Update secrets from CPython 3.10.6
  • Loading branch information
CPython Developers authored and youknowone committed Aug 14, 2022
commit b6523ddb90eb7e4c8e5d74492d36b124ac624b8d
3 changes: 1 addition & 2 deletions Lib/secrets.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

import base64
import binascii
import os

from hmac import compare_digest
from random import SystemRandom
Expand Down Expand Up @@ -44,7 +43,7 @@ def token_bytes(nbytes=None):
"""
if nbytes is None:
nbytes = DEFAULT_ENTROPY
return os.urandom(nbytes)
return _sysrand.randbytes(nbytes)

def token_hex(nbytes=None):
"""Return a random text string, in hexadecimal.
Expand Down