Skip to content

Commit da09ef8

Browse files
authored
gh-149221: Minor comment edit (gh-149278)
Minor comment edit
1 parent 4f0cfe5 commit da09ef8

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

Lib/random.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -838,9 +838,8 @@ def binomialvariate(self, n=1, p=0.5):
838838
while True:
839839
try:
840840
y += _floor(_log2(random()) / c) + 1
841-
# The random() function can return 0.0, which causes log2(0.0) to raise a ValueError.
842-
# See https://github.com/python/cpython/issue/149221
843841
except ValueError:
842+
# Reject case where random() returned 0.0
844843
continue
845844
if y > n:
846845
return x

0 commit comments

Comments
 (0)