Skip to content

Commit 30188d4

Browse files
typing
1 parent b5a427f commit 30188d4

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

sentry_sdk/integrations/django/middleware.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,10 @@
2222
from typing import Callable
2323
from typing import Optional
2424
from typing import TypeVar
25+
from typing import Union
2526

2627
from sentry_sdk.tracing import Span
28+
from sentry_sdk.traces import StreamedSpan
2729

2830
F = TypeVar("F", bound=Callable[..., Any])
2931

@@ -84,6 +86,7 @@ def _check_middleware_span(old_method: "Callable[..., Any]") -> "Optional[Span]"
8486
client = sentry_sdk.get_client()
8587
span_streaming = has_span_streaming_enabled(client.options)
8688

89+
middleware_span: "Union[Span, StreamedSpan]"
8790
if span_streaming:
8891
middleware_span = sentry_sdk.traces.start_span(
8992
name=description,

0 commit comments

Comments
 (0)