From 50303873082c9ea4518cf4f39c3eb9cf8e5db1d8 Mon Sep 17 00:00:00 2001 From: Roman Mogylatov Date: Wed, 21 May 2025 16:02:22 -0400 Subject: [PATCH] Update src/dependency_injector/wiring.py Co-authored-by: ZipFile --- src/dependency_injector/wiring.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/dependency_injector/wiring.py b/src/dependency_injector/wiring.py index 898ac377..6829d53b 100644 --- a/src/dependency_injector/wiring.py +++ b/src/dependency_injector/wiring.py @@ -1031,10 +1031,11 @@ def _get_sync_patched(fn: F, patched: PatchedCallable) -> F: return cast(F, _patched) -def _get_annotations(obj: Any) -> Dict[str, Any]: - if sys.version_info >= (3, 10): +if sys.version_info >= (3, 10): + def _get_annotations(obj: Any) -> Dict[str, Any]: return inspect.get_annotations(obj) - else: +else: + def _get_annotations(obj: Any) -> Dict[str, Any]: return getattr(obj, "__annotations__", {})