Skip to content

Commit

Permalink
Merge pull request #320 from ApostolFet/improve_wrapper
Browse files Browse the repository at this point in the history
improve wrap_injection
  • Loading branch information
Tishka17 authored Dec 2, 2024
2 parents 76feb1d 1ba9e45 commit e6d5760
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/dishka/integrations/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 102,14 @@ def wrap_injection(
continue
dependencies[name] = dep

if not dependencies:
try:
func.__dishka_injected__ = True # type: ignore[attr-defined]
except AttributeError:
pass
else:
return func

if remove_depends:
new_annotations = {
name: hint
Expand All @@ -115,7 123,7 @@ def wrap_injection(
]
else:
new_annotations = hints.copy()
new_params = list(func_signature.parameters.copy().values())
new_params = list(func_signature.parameters.values())

auto_injected_func: Callable[P, T | Awaitable[T]]
if additional_params:
Expand Down

0 comments on commit e6d5760

Please sign in to comment.