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 058402d commit f04e751Copy full SHA for f04e751
tests/utils.py
@@ -11,17 +11,18 @@ def __init__(self):
11
self._counter = 1
12
13
def __new__(cls):
14
- with cls._lock:
15
- if cls._instance is None:
16
- cls._instance = super().__new__(cls)
17
- cls._instance._counter = 1
18
- return cls._instance
+ if cls._instance is None:
+ with cls._lock:
+ cls._instance = super().__new__(cls)
+ cls._instance._counter = 1
19
+ return cls._instance
20
21
def next(self):
22
with self._lock:
23
current = self._counter
24
self._counter += 1
- return current
25
+ return current
26
27
28
seq = SequenceGenerator()
0 commit comments