Skip to content

Commit 7f14e05

Browse files
committed
lint fixes
Signed-off-by: Lea Konvalinka <lea.konvalinka@dynatrace.com>
1 parent 5d11dbc commit 7f14e05

3 files changed

Lines changed: 8 additions & 6 deletions

File tree

openfeature/_event_support.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,6 @@ def _run_handler(handler: EventHandler, details: EventDetails) -> None:
141141

142142

143143
def clear() -> None:
144-
with _global_lock:
145-
with _client_lock:
146-
_global_handlers.clear()
147-
_client_handlers.clear()
144+
with _global_lock, _client_lock:
145+
_global_handlers.clear()
146+
_client_handlers.clear()

openfeature/hook/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,12 +152,14 @@ def supports_flag_value_type(self, flag_type: FlagType) -> bool:
152152
"""
153153
return True
154154

155+
155156
# while the lock guarantees safety, even without it there was never a loss within 50.000 runs (with the default GIL
156157
# switch interval of 5ms). only when the switch interval was significantly shortened to 0.1 microseconds, losses were
157158
# observed without locks every now and then. with a no-GIL python, the lock would be essential
158159

160+
159161
def add_hooks(hooks: list[Hook]) -> None:
160-
with _hooks_lock:
162+
with _hooks_lock:
161163
global _hooks
162164
_hooks = _hooks + hooks
163165

openfeature/provider/_registry.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import threading
22

3-
from openfeature._event_support import run_handlers_for_provider, clear as clear_event_handlers
3+
from openfeature._event_support import clear as clear_event_handlers
4+
from openfeature._event_support import run_handlers_for_provider
45
from openfeature.evaluation_context import EvaluationContext, get_evaluation_context
56
from openfeature.event import (
67
ProviderEvent,

0 commit comments

Comments
 (0)