Skip to content

Commit c2da81b

Browse files
.
1 parent 790b198 commit c2da81b

2 files changed

Lines changed: 4 additions & 5 deletions

File tree

sentry_sdk/integrations/mcp.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
if TYPE_CHECKING:
5656
from typing import Any, Callable, ContextManager, Optional, Tuple, Union
5757

58-
from starlette.types import Receive, Scope, Send # type: ignore[import-not-found]
58+
from starlette.types import Receive, Scope, Send
5959

6060
from sentry_sdk.traces import StreamedSpan
6161
from sentry_sdk.tracing import Span

sentry_sdk/integrations/starlette.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,9 @@
4242
if TYPE_CHECKING:
4343
from typing import Any, Awaitable, Callable, Container, Dict, Optional, Tuple, Union
4444

45-
from sentry_sdk._types import Event, HttpStatusCodeRange
45+
from starlette.middleware import _MiddlewareFactory
4646

47+
from sentry_sdk._types import Event, HttpStatusCodeRange
4748
try:
4849
import starlette
4950
from starlette import __version__ as STARLETTE_VERSION
@@ -156,7 +157,7 @@ def setup_once() -> None:
156157
patch_templates()
157158

158159

159-
def _enable_span_for_middleware(middleware_class: "Any") -> type:
160+
def _enable_span_for_middleware(middleware_class: "Any") -> _MiddlewareFactory[...,]:
160161
old_call = middleware_class.__call__
161162

162163
async def _create_span_call(
@@ -701,8 +702,6 @@ class StarletteRequestExtractor:
701702
(like form data or cookies) and adds it to the Sentry event.
702703
"""
703704

704-
request: "Request" = None
705-
706705
def __init__(self: "StarletteRequestExtractor", request: "Request") -> None:
707706
self.request = request
708707

0 commit comments

Comments
 (0)