From 87502ddd710eb1f030b8ff5a60b05becea3f474f Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Fri, 17 Apr 2020 22:54:38 +0200 Subject: bpo-40286: Use random.randbytes() in tests (GH-19575) --- Lib/test/test_tarfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Lib/test/test_tarfile.py') diff --git a/Lib/test/test_tarfile.py b/Lib/test/test_tarfile.py index cae96802de..99196f6043 100644 --- a/Lib/test/test_tarfile.py +++ b/Lib/test/test_tarfile.py @@ -386,7 +386,7 @@ class CommonReadTest(ReadTest): def test_ignore_zeros(self): # Test TarFile's ignore_zeros option. # generate 512 pseudorandom bytes - data = Random(0).getrandbits(512*8).to_bytes(512, 'big') + data = Random(0).randbytes(512) for char in (b'\0', b'a'): # Test if EOFHeaderError ('\0') and InvalidHeaderError ('a') # are ignored correctly. -- cgit v1.2.1