Browse Source

several more ignores

pull/15091/head
svlandeg 4 months ago
parent
commit
09ec28bac8
  1. 2
      fastapi/applications.py
  2. 6
      fastapi/dependencies/utils.py

2
fastapi/applications.py

@ -4597,7 +4597,7 @@ class FastAPI(Starlette):
Read more about it in the
[FastAPI docs for Lifespan Events](https://fastapi.tiangolo.com/advanced/events/#alternative-events-deprecated).
"""
return self.router.on_event(event_type)
return self.router.on_event(event_type) # ty: ignore[deprecated]
def middleware(
self,

6
fastapi/dependencies/utils.py

@ -33,7 +33,7 @@ from fastapi._compat import (
Undefined,
copy_field_info,
create_body_model,
evaluate_forwardref,
evaluate_forwardref, # ty: ignore[deprecated]
field_annotation_is_scalar,
field_annotation_is_scalar_sequence,
field_annotation_is_sequence,
@ -245,7 +245,7 @@ def get_typed_signature(call: Callable[..., Any]) -> inspect.Signature:
def get_typed_annotation(annotation: Any, globalns: dict[str, Any]) -> Any:
if isinstance(annotation, str):
annotation = ForwardRef(annotation)
annotation = evaluate_forwardref(annotation, globalns, globalns)
annotation = evaluate_forwardref(annotation, globalns, globalns) # ty: ignore[deprecated]
if annotation is type(None):
return None
return annotation
@ -323,7 +323,7 @@ def get_dependant(
):
assert dependant.call
raise DependencyScopeError(
f'The dependency "{dependant.call.__name__}" has a scope of '
f'The dependency "{dependant.call.__name__}" has a scope of ' # ty: ignore[unresolved-attribute]
'"request", it cannot depend on dependencies with scope "function".'
)
sub_own_oauth_scopes: list[str] = []

Loading…
Cancel
Save