File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change 1+ # ruff: noqa: ARG001
12try :
23 from secrets import choice , randbelow , token_bytes
34
@@ -20,6 +21,7 @@ def seed(v=None):
2021 # don't completely throw away the existing state, but add some
2122 # more random state to the existing state
2223 def seed (v = None ):
24+ # ruff: noqa: PLC0415
2325 import os
2426 import time
2527 _r .seed ((_r .getstate (),
@@ -39,9 +41,9 @@ def randbelow(i):
3941 return _r .randint (0 , i - 1 )
4042
4143 if hasattr (_os , 'urandom' ):
42- def token_bytes (l ):
43- return _os .urandom (l )
44+ def token_bytes (size ):
45+ return _os .urandom (size )
4446 else :
45- def token_bytes (l ):
46- _bchr = chr if str == bytes else lambda x : bytes ((x ,))
47- return b'' .join ([_bchr (_r .getrandbits (8 )) for i in range (l )])
47+ def token_bytes (size ):
48+ _bchr = chr if str is bytes else lambda x : bytes ((x ,))
49+ return b'' .join ([_bchr (_r .getrandbits (8 )) for i in range (size )])
You can’t perform that action at this time.
0 commit comments