Skip to content

Commit 102a16e

Browse files
committed
feat: pass client
1 parent 496b9f4 commit 102a16e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

posthog/__init__.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,14 @@
2323
"""Context management."""
2424

2525

26-
def new_context(fresh=False, capture_exceptions=True):
26+
def new_context(fresh=False, capture_exceptions=True, client=None):
2727
"""
2828
Create a new context scope that will be active for the duration of the with block.
2929
3030
Args:
3131
fresh: Whether to start with a fresh context (default: False)
3232
capture_exceptions: Whether to capture exceptions raised within the context (default: True)
33+
client: Optional Posthog client instance to use for this context (default: None)
3334
3435
Examples:
3536
```python
@@ -42,7 +43,7 @@ def new_context(fresh=False, capture_exceptions=True):
4243
Category:
4344
Contexts
4445
"""
45-
return inner_new_context(fresh=fresh, capture_exceptions=capture_exceptions)
46+
return inner_new_context(fresh=fresh, capture_exceptions=capture_exceptions, client=client)
4647

4748

4849
def scoped(fresh=False, capture_exceptions=True):

0 commit comments

Comments
 (0)