mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Properly parenthesize a long Boolean combination. Formerly, you could
pass invalid seed values.
This commit is contained in:
parent
3c83bb49d0
commit
6757748641
1 changed files with 1 additions and 1 deletions
|
@ -44,7 +44,7 @@ class whrandom:
|
|||
def seed(self, x = 0, y = 0, z = 0):
|
||||
if not type(x) == type(y) == type(z) == type(0):
|
||||
raise TypeError, 'seeds must be integers'
|
||||
if not 0 <= x < 256 and 0 <= y < 256 and 0 <= z < 256:
|
||||
if not (0 <= x < 256 and 0 <= y < 256 and 0 <= z < 256):
|
||||
raise ValueError, 'seeds must be in range(0, 256)'
|
||||
if 0 == x == y == z:
|
||||
# Initialize from current time
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue