SIGN IN SIGN UP

[3.13] Fix a compiler warning in _randommodule.c (GH-141058) (#141064)

Fix a compiler warning in _randommodule.c (GH-141058)

The test just before the cast ensures that the cast cannot overflow.

Fix the warning on 32-bit Windows:

    Modules\_randommodule.c(525,28): warning C4244: '=': conversion
    from 'uint64_t' to 'Py_ssize_t', possible loss of data
(cherry picked from commit 4ac16dd10950fad2d3e58e8b0ba5f2e621af3cc1)

Co-authored-by: Victor Stinner <vstinner@python.org>
M
Miss Islington (bot) committed
3ecf63754ea2ea4114c9ec51d0b95ca218762706
Parent: 91b85c5
Committed by GitHub <noreply@github.com> on 11/5/2025, 7:08:41 PM