summaryrefslogtreecommitdiffstats
path: root/Lib/random.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/random.py')
-rw-r--r--Lib/random.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/Lib/random.py b/Lib/random.py
index 3a835ae..1310a2d 100644
--- a/Lib/random.py
+++ b/Lib/random.py
@@ -154,8 +154,7 @@ class Random(_random.Random):
elif version == 2 and isinstance(a, (str, bytes, bytearray)):
if isinstance(a, str):
a = a.encode()
- a += _sha512(a).digest()
- a = int.from_bytes(a, 'big')
+ a = int.from_bytes(a + _sha512(a).digest(), 'big')
elif not isinstance(a, (type(None), int, float, str, bytes, bytearray)):
_warn('Seeding based on hashing is deprecated\n'