Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions lib/Crypto/Random/random.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,7 @@ def randrange(self, *args):
if step == 0:
raise ValueError("randrange step argument must not be zero")

num_choices = ceil_div(stop - start, step)
if num_choices < 0:
num_choices = 0
num_choices = max(ceil_div(stop - start, step), 0)
if num_choices < 1:
raise ValueError("empty range for randrange(%r, %r, %r)" % (start, stop, step))

Expand Down
Loading