Use random.sample in AudioCaptcha

This commit is contained in:
Hsiaoming Yang
2014-11-26 19:37:52 +08:00
parent 33d3d28a6d
commit f75691fd52

View File

@@ -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."""