diff Lib/whrandom.py @ 4852:29ced485aca0 legacy-trunk

Properly parenthesize a long Boolean combination. Formerly, you could pass invalid seed values.
author Guido van Rossum <guido@python.org>
date Thu, 02 Jan 1997 18:13:35 +0000
parents f2f946bd7f47
children 4b42eea10a02
line wrap: on
line diff
--- a/Lib/whrandom.py	Tue Dec 31 22:35:16 1996 +0000
+++ b/Lib/whrandom.py	Thu Jan 02 18:13:35 1997 +0000
@@ -44,7 +44,7 @@
 	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