Minor beautification (turn nested-if into a conjunction).

This commit is contained in:
Raymond Hettinger 2016-08-31 23:00:32 -07:00
parent 5f30f79357
commit 2f9cc7ab0c
1 changed files with 5 additions and 6 deletions

View File

@ -119,12 +119,11 @@ class Random(_random.Random):
x ^= len(a)
a = -2 if x == -1 else x
if version == 2:
if isinstance(a, (str, bytes, bytearray)):
if isinstance(a, str):
a = a.encode()
a += _sha512(a).digest()
a = int.from_bytes(a, 'big')
if 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')
super().seed(a)
self.gauss_next = None