Update src/dependency_injector/wiring.py

Co-authored-by: ZipFile <zipfile.d@protonmail.com>
This commit is contained in:
Roman Mogylatov 2025-05-21 16:02:22 -04:00 committed by GitHub
parent 2ab78f34eb
commit 5030387308
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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__", {})