mirror of
https://github.com/python/cpython.git
synced 2025-11-01 18:51:43 +00:00
Issue #29061: secrets.randbelow() would hang with a negative input
This commit is contained in:
parent
9ea82ddad5
commit
e9ee207622
4 changed files with 7 additions and 0 deletions
|
|
@ -70,6 +70,7 @@ class Random_Tests(unittest.TestCase):
|
|||
for i in range(2, 10):
|
||||
self.assertIn(secrets.randbelow(i), range(i))
|
||||
self.assertRaises(ValueError, secrets.randbelow, 0)
|
||||
self.assertRaises(ValueError, secrets.randbelow, -1)
|
||||
|
||||
|
||||
class Token_Tests(unittest.TestCase):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue