mirror of
https://github.com/lepture/captcha.git
synced 2026-03-13 09:43:22 +08:00
Use random.sample in AudioCaptcha
This commit is contained in:
@@ -193,8 +193,7 @@ class AudioCaptcha(object):
|
||||
|
||||
:param length: the return string length.
|
||||
"""
|
||||
for i in range(length):
|
||||
yield random.choice(self.choices)
|
||||
return random.sample(self.choices, length)
|
||||
|
||||
def load(self):
|
||||
"""Load voice data into memory."""
|
||||
|
||||
Reference in New Issue
Block a user