[svn r38726] shuffle -> sample

--HG--
branch : trunk
This commit is contained in:
fijal 2007-02-13 17:37:26 +01:00
parent 97a82f2df2
commit 614675743d
1 changed files with 2 additions and 3 deletions

View File

@ -178,9 +178,8 @@ class ExportedMethods(BasicExternal):
self._sesslock.acquire() self._sesslock.acquire()
try: try:
while 1: while 1:
chars = list(py.std.string.lowercase) sessid = ''.join(py.std.random.sample(
py.std.random.shuffle(chars) py.std.string.lowercase, 8))
sessid = ''.join(chars[:8])
if sessid not in self._sessids: if sessid not in self._sessids:
self._sessids.append(sessid) self._sessids.append(sessid)
break break