]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Improve variable name (don't shadow a builtin).
authorRaymond Hettinger <python@rcn.com>
Wed, 8 Sep 2010 19:27:59 +0000 (19:27 +0000)
committerRaymond Hettinger <python@rcn.com>
Wed, 8 Sep 2010 19:27:59 +0000 (19:27 +0000)
Lib/random.py

index e4073ddb5a857f27dce806bc1150853f6fecd114..83a070cd3258e37d68b79fb9ea87a9c674a78c81 100644 (file)
@@ -634,9 +634,9 @@ class SystemRandom(Random):
             raise ValueError('number of bits must be greater than zero')
         if k != int(k):
             raise TypeError('number of bits should be an integer')
-        bytes = (k + 7) // 8                    # bits / 8 and rounded up
-        x = int.from_bytes(_urandom(bytes), 'big')
-        return x >> (bytes * 8 - k)             # trim excess bits
+        numbytes = (k + 7) // 8                       # bits / 8 and rounded up
+        x = int.from_bytes(_urandom(numbytes), 'big')
+        return x >> (numbytes * 8 - k)                # trim excess bits
 
     def seed(self, *args, **kwds):
         "Stub method.  Not used for a system random number generator."