Skip to content

Commit

Permalink
pythongh-109653: Reduce the import time of random by 60% (python#11…
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexWaygood authored and Glyphack committed Jan 27, 2024
1 parent f92985b commit c35196c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Lib/random.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@

try:
# hashlib is pretty heavy to load, try lean internal module first
from _sha512 import sha512 as _sha512
from _sha2 import sha512 as _sha512
except ImportError:
# fallback to official implementation
from hashlib import sha512 as _sha512
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Fix a Python 3.12 regression in the import time of :mod:`random`. Patch by Alex
Waygood.

0 comments on commit c35196c

Please sign in to comment.