We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2fd9eb9 commit b40dcb7Copy full SHA for b40dcb7
Lib/tempfile.py
@@ -42,8 +42,7 @@
42
import os as _os
43
import shutil as _shutil
44
import errno as _errno
45
-# XXX RustPython TODO: _random
46
-#from random import Random as _Random
+from random import Random as _Random
47
import weakref as _weakref
48
49
try:
@@ -157,11 +156,7 @@ def __iter__(self):
157
156
158
def __next__(self):
159
c = self.characters
160
- def choose(s):
161
- import math, random
162
- return s[math.floor(random.random() * len(s))]
163
- # XXX RustPython TODO: proper random impl
164
- # choose = self.rng.choose
+ choose = self.rng.choice
165
letters = [choose(c) for dummy in range(8)]
166
return ''.join(letters)
167
0 commit comments