Update fastapi/dependencies/utils.py

Co-authored-by: Yurii Karabas <1998uriyyo@gmail.com>
This commit is contained in:
[object Object] 2022-06-26 11:06:50 -07:00 committed by GitHub
parent c3591b32b9
commit f412d36f62
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 6 deletions

View File

@ -245,12 +245,7 @@ def is_scalar_sequence_field(field: ModelField) -> bool:
def get_typed_signature(call: Callable[..., Any]) -> inspect.Signature:
signature = inspect.signature(call)
nsobj = call
while hasattr(nsobj, "__wrapped__"):
# The __wrapped__ attribute is set by decorators, e.g. functools.wraps.
# This while loop allows rereferencing forward references on decorated
# methods.
nsobj = nsobj.__wrapped__ # type: ignore
nsobj = inspect.unwrap(call)
globalns = getattr(nsobj, "__globals__", {})
typed_params = [
inspect.Parameter(