mirror of
https://github.com/Legrandin/pycryptodome.git
synced 2025-10-22 09:23:58 +00:00
Fix AllOrNothing and random.sample()
o AllOrNothing no longer fails occasionally. Patch by Lorenz Quack o random.sample() works on Python 2.1. Patch by Paul Koning and Lorenz Quack
This commit is contained in:
parent
b27696462b
commit
60896cc61a
3 changed files with 7 additions and 9 deletions
|
@ -122,7 +122,7 @@ class StrongRandom(object):
|
|||
selected = {} # we emulate a set using a dict here
|
||||
for i in xrange(k):
|
||||
r = None
|
||||
while r is None or r in selected:
|
||||
while r is None or selected.has_key(r):
|
||||
r = self.randrange(num_choices)
|
||||
retval.append(population[r])
|
||||
selected[r] = 1
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue