Skip to content

Commit 406c68d

Browse files
Correct use_scope comment (#2790)
1 parent a03108f commit 406c68d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

sentry_sdk/scope.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1514,12 +1514,14 @@ def use_scope(scope):
15141514
After the wrapped code is executed, the original scope is restored.
15151515
15161516
Example Usage:
1517+
Suppose the variable `scope` contains a `Scope` object, which is not currently
1518+
the active scope.
15171519
15181520
.. code-block:: python
15191521
15201522
import sentry_sdk
15211523
1522-
with sentry_sdk.new_scope() as scope:
1524+
with sentry_sdk.use_scope(scope):
15231525
scope.set_tag("color", "green")
15241526
sentry_sdk.capture_message("hello") # will include `color` tag.
15251527

0 commit comments

Comments
 (0)