summaryrefslogtreecommitdiffstats
path: root/Lib/whrandom.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1997-01-02 18:13:35 (GMT)
committerGuido van Rossum <guido@python.org>1997-01-02 18:13:35 (GMT)
commit6757748641b45fa9c51dd58b5315628bf7744b22 (patch)
tree27e22c57f7fdca95f43b0ba471b8ab9b2486c554 /Lib/whrandom.py
parent3c83bb49d0caa5eeaf6d5fc2a97db6044e62a21f (diff)
downloadcpython-6757748641b45fa9c51dd58b5315628bf7744b22.zip
cpython-6757748641b45fa9c51dd58b5315628bf7744b22.tar.gz
cpython-6757748641b45fa9c51dd58b5315628bf7744b22.tar.bz2
Properly parenthesize a long Boolean combination. Formerly, you could
pass invalid seed values.
Diffstat (limited to 'Lib/whrandom.py')
-rw-r--r--Lib/whrandom.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/whrandom.py b/Lib/whrandom.py
index 3cc1532..8250234 100644
--- a/Lib/whrandom.py
+++ b/Lib/whrandom.py
@@ -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