]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.11] gh-110332: Remove mentions of `random.WichmannHill` from `test_zlib` (GH-11033...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Wed, 4 Oct 2023 11:17:38 +0000 (04:17 -0700)
committerGitHub <noreply@github.com>
Wed, 4 Oct 2023 11:17:38 +0000 (11:17 +0000)
gh-110332: Remove mentions of `random.WichmannHill` from `test_zlib` (GH-110334)
(cherry picked from commit e9f2352b7b7503519790ee6f51c2e298cf390e75)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
Lib/test/test_zlib.py

index f20aad051da960003ccb591fe9b30788e824273c..ff5ce11b965b7cfe9f45381b1487dd784cdea476 100644 (file)
@@ -516,18 +516,7 @@ class CompressObjectTestCase(BaseCompressTestCase, unittest.TestCase):
 
         # Try 17K of data
         # generate random data stream
-        try:
-            # In 2.3 and later, WichmannHill is the RNG of the bug report
-            gen = random.WichmannHill()
-        except AttributeError:
-            try:
-                # 2.2 called it Random
-                gen = random.Random()
-            except AttributeError:
-                # others might simply have a single RNG
-                gen = random
-        gen.seed(1)
-        data = gen.randbytes(17 * 1024)
+        data = random.randbytes(17 * 1024)
 
         # compress, sync-flush, and decompress
         first = co.compress(data)