gh-149221: Minor comment edit (gh-149278)

Minor comment edit
This commit is contained in:
Raymond Hettinger
2026-05-02 08:29:06 -05:00
committed by GitHub
parent 4f0cfe53cb
commit da09ef807b
+1 -2
View File
@@ -838,9 +838,8 @@ class Random(_random.Random):
while True:
try:
y += _floor(_log2(random()) / c) + 1
# The random() function can return 0.0, which causes log2(0.0) to raise a ValueError.
# See https://github.com/python/cpython/issue/149221
except ValueError:
# Reject case where random() returned 0.0
continue
if y > n:
return x