]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-149221: Minor comment edit (gh-149278)
authorRaymond Hettinger <rhettinger@users.noreply.github.com>
Sat, 2 May 2026 13:29:06 +0000 (08:29 -0500)
committerGitHub <noreply@github.com>
Sat, 2 May 2026 13:29:06 +0000 (08:29 -0500)
Minor comment edit

Lib/random.py

index dc037629bab0db090f2b64dfbc0b96b8ce1762d7..726a71e782893c88b6c1385f68352b30d51d1f36 100644 (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