Skip to content

Commit b1656bb

Browse files
committed
mypy
1 parent 86af698 commit b1656bb

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

posthog/scopes.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,18 @@
11
import sys
2+
import threading
23
from contextlib import contextmanager
34
from typing import Any, Callable, Dict, TypeVar, cast
45

56
# Use contextvars if available (Python 3.7+), otherwise fall back to threading.local
67
if sys.version_info >= (3, 7):
78
import contextvars
8-
99
_context_stack: contextvars.ContextVar[list] = contextvars.ContextVar("posthog_context_stack", default=[{}])
1010
_use_contextvars = True
1111
else:
12-
import threading
13-
14-
_scopes_local = threading.local()
1512
_use_contextvars = False
1613

14+
_scopes_local = threading.local()
15+
1716

1817
def _init_guard() -> None:
1918
if not _use_contextvars and not hasattr(_scopes_local, "context_stack"):

setup.cfg

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,3 @@ universal = 1
33

44
[tool:pytest]
55
asyncio_mode = auto
6-
asyncio_default_fixture_loop_scope = function

0 commit comments

Comments
 (0)