Skip to content

Commit

Permalink
Use random.getrandbits for compatibility with python 3.8
Browse files Browse the repository at this point in the history
  • Loading branch information
donRumata03 committed Mar 30, 2024
1 parent 921604c commit e8035ac
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def stabilize_random():
set_random_seed(42)

def urandom_mock(n):
return random.randbytes(n)
return bytes(random.getrandbits(8) for _ in range(n))

# os.random is the source of random used in the uuid library
# normally, it's „true“ random, but to stabilize tests,
Expand Down

0 comments on commit e8035ac

Please sign in to comment.