mirror of
https://github.com/python/cpython.git
synced 2025-07-09 20:35:26 +00:00
gh-109653: Reduce the import time of random
by 60% (#110221)
This commit is contained in:
parent
4596c76d1a
commit
21a6263020
2 changed files with 3 additions and 1 deletions
|
@ -65,7 +65,7 @@ import _random
|
|||
|
||||
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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue