Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f412d36

Browse files
lucaswimanuriyyo
andauthored
Update fastapi/dependencies/utils.py
Co-authored-by: Yurii Karabas <[email protected]>
1 parent c3591b3 commit f412d36

1 file changed

Lines changed: 1 addition & 6 deletions

File tree

fastapi/dependencies/utils.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -245,12 +245,7 @@ def is_scalar_sequence_field(field: ModelField) -> bool:
245245

246246
def get_typed_signature(call: Callable[..., Any]) -> inspect.Signature:
247247
signature = inspect.signature(call)
248-
nsobj = call
249-
while hasattr(nsobj, "__wrapped__"):
250-
# The __wrapped__ attribute is set by decorators, e.g. functools.wraps.
251-
# This while loop allows rereferencing forward references on decorated
252-
# methods.
253-
nsobj = nsobj.__wrapped__ # type: ignore
248+
nsobj = inspect.unwrap(call)
254249
globalns = getattr(nsobj, "__globals__", {})
255250
typed_params = [
256251
inspect.Parameter(

0 commit comments

Comments
 (0)