File tree Expand file tree Collapse file tree 3 files changed +8
-6
lines changed Expand file tree Collapse file tree 3 files changed +8
-6
lines changed Original file line number Diff line number Diff line change 11
11
PotelScope as Scope ,
12
12
new_scope ,
13
13
isolation_scope ,
14
+ use_scope ,
15
+ use_isolation_scope ,
14
16
)
15
17
16
18
77
79
"start_transaction" ,
78
80
"trace" ,
79
81
"monitor" ,
82
+ "use_scope" ,
83
+ "use_isolation_scope" ,
80
84
]
81
85
82
86
Original file line number Diff line number Diff line change 4
4
5
5
import sentry_sdk
6
6
from sentry_sdk .integrations import Integration
7
- from sentry_sdk .scope import use_isolation_scope , use_scope
8
7
from sentry_sdk .utils import (
9
8
ensure_integration_enabled ,
10
9
event_from_exception ,
@@ -95,8 +94,8 @@ def _run_old_run_func():
95
94
reraise (* _capture_exception ())
96
95
97
96
if isolation_scope_to_use is not None and current_scope_to_use is not None :
98
- with use_isolation_scope (isolation_scope_to_use ):
99
- with use_scope (current_scope_to_use ):
97
+ with sentry_sdk . use_isolation_scope (isolation_scope_to_use ):
98
+ with sentry_sdk . use_scope (current_scope_to_use ):
100
99
return _run_old_run_func ()
101
100
else :
102
101
return _run_old_run_func ()
Original file line number Diff line number Diff line change 7
7
from sentry_sdk .scope import should_send_default_pii
8
8
from sentry_sdk .integrations ._wsgi_common import _filter_headers
9
9
from sentry_sdk .sessions import track_session
10
- from sentry_sdk .scope import use_isolation_scope
11
10
from sentry_sdk .tracing import Transaction , TRANSACTION_SOURCE_ROUTE
12
11
from sentry_sdk .utils import (
13
12
ContextVar ,
@@ -219,7 +218,7 @@ def __iter__(self):
219
218
iterator = iter (self ._response )
220
219
221
220
while True :
222
- with use_isolation_scope (self ._scope ):
221
+ with sentry_sdk . use_isolation_scope (self ._scope ):
223
222
try :
224
223
chunk = next (iterator )
225
224
except StopIteration :
@@ -231,7 +230,7 @@ def __iter__(self):
231
230
232
231
def close (self ):
233
232
# type: () -> None
234
- with use_isolation_scope (self ._scope ):
233
+ with sentry_sdk . use_isolation_scope (self ._scope ):
235
234
try :
236
235
self ._response .close () # type: ignore
237
236
except AttributeError :
You can’t perform that action at this time.
0 commit comments