From: Guido van Rossum Date: Thu, 2 Jan 1997 18:13:35 +0000 (+0000) Subject: Properly parenthesize a long Boolean combination. Formerly, you could X-Git-Tag: v1.5a1~624 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6757748641b45fa9c51dd58b5315628bf7744b22;p=python Properly parenthesize a long Boolean combination. Formerly, you could pass invalid seed values. --- diff --git a/Lib/whrandom.py b/Lib/whrandom.py index 3cc15323b5..8250234dcb 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