File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change 22import contextlib
33import logging
44import os
5- import tempfile
5+ import random
66import time
77import warnings
88from typing import Callable , Optional
1515RETRY_TIMEOUT_SECONDS = int (os .getenv ("RETRY_TIMEOUT_SECONDS" , 8 ))
1616RETRY_INTERVAL_SECONDS = float (os .getenv ("RETRY_INTERVAL_SECONDS" , 0.05 ))
1717
18- namer = tempfile ._RandomNameSequence ()
18+
19+ class RandomStrSequence :
20+ def __init__ (self , characters : str = "abcdefghijklmnopqrstuvwxyz0123456789_" ):
21+ self .characters : str = characters
22+
23+ def __iter__ (self ):
24+ return self
25+
26+ def __next__ (self ):
27+ return "" .join (random .sample (self .characters , k = 8 ))
28+
29+
30+ namer = RandomStrSequence ()
1931current_dir = os .path .abspath (os .path .dirname (__file__ ))
2032example_dir = os .path .abspath (os .path .join (current_dir , ".." , "examples" ))
2133fixtures_dir = os .path .realpath (os .path .join (current_dir , "fixtures" ))
You can’t perform that action at this time.
0 commit comments