Skip to content

Commit

Permalink
Fix call to random.randint to use integer arguments.
Browse files Browse the repository at this point in the history
Python 3.12 will no longer convert float to integer arguments and instead will raise an error.

https://docs.python.org/3/whatsnew/3.12.html#changes-in-the-python-api
> Formerly, randrange(10.0) losslessly converted to randrange(10). Now, it raises a TypeError.

PiperOrigin-RevId: 723521435
  • Loading branch information
ZacharyGarrett authored and copybara-github committed Feb 5, 2025
1 parent 625c89f commit ed886be
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def __init__(
):
self._initializer_type = initializer_type
if base_seed is None:
base_seed = random.randint(1, 1e9)
base_seed = random.randint(1, 1_000_000_000)
self._base_seed = base_seed

def __call__(self):
Expand Down

0 comments on commit ed886be

Please sign in to comment.