Skip to content

Commit

Permalink
chore: cosmetic rename of di local var in get
Browse files Browse the repository at this point in the history
  • Loading branch information
z3z1ma committed Aug 12, 2024
1 parent 250acaa commit 28c519e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/cdf/core/injector/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -442,16 +442,16 @@ def wrapper(*args: P.args, **kwargs: P.kwargs) -> T:
if param.default not in (param.empty, None):
continue
if name not in bound_args.arguments:
obj = None
dep = None
# Try to resolve a typed dependency
if _is_typed(param.annotation):
obj = self.get((name, param.annotation))
dep = self.get((name, param.annotation))
# Fallback to untyped injection
if obj is None:
obj = self.get(name)
if dep is None:
dep = self.get(name)
# If a dependency is found, inject it
if obj is not None:
bound_args.arguments[name] = obj
if dep is not None:
bound_args.arguments[name] = dep
bound_args.apply_defaults()
return func_or_cls(*bound_args.args, **bound_args.kwargs)

Expand Down

0 comments on commit 28c519e

Please sign in to comment.