mirror of
https://github.com/ets-labs/python-dependency-injector.git
synced 2024-11-23 10:03:56 +03:00
Remove f-strings from set_provides()
This commit is contained in:
parent
fad03f2957
commit
7407758827
File diff suppressed because it is too large
Load Diff
|
@ -1072,8 +1072,10 @@ cdef class Callable(Provider):
|
||||||
"""Set provider's provides."""
|
"""Set provider's provides."""
|
||||||
if provides and not callable(provides):
|
if provides and not callable(provides):
|
||||||
raise Error(
|
raise Error(
|
||||||
f'Provider {_class_qualname(self)} expected to get callable, '
|
'Provider {0} expected to get callable, got {1} instead'.format(
|
||||||
f'got {provides} instead'
|
_class_qualname(self),
|
||||||
|
provides,
|
||||||
|
),
|
||||||
)
|
)
|
||||||
self.__provides = provides
|
self.__provides = provides
|
||||||
return self
|
return self
|
||||||
|
@ -2138,8 +2140,10 @@ cdef class Factory(Provider):
|
||||||
and self.__class__.provided_type and
|
and self.__class__.provided_type and
|
||||||
not issubclass(provides, self.__class__.provided_type)):
|
not issubclass(provides, self.__class__.provided_type)):
|
||||||
raise Error(
|
raise Error(
|
||||||
f'{_class_qualname(self)} can provide only '
|
'{0} can provide only {1} instances'.format(
|
||||||
f'{self.__class__.provided_type} instances'
|
_class_qualname(self),
|
||||||
|
self.__class__.provided_type,
|
||||||
|
),
|
||||||
)
|
)
|
||||||
self.__instantiator.set_provides(provides)
|
self.__instantiator.set_provides(provides)
|
||||||
return self
|
return self
|
||||||
|
@ -2503,8 +2507,10 @@ cdef class BaseSingleton(Provider):
|
||||||
and self.__class__.provided_type and
|
and self.__class__.provided_type and
|
||||||
not issubclass(provides, self.__class__.provided_type)):
|
not issubclass(provides, self.__class__.provided_type)):
|
||||||
raise Error(
|
raise Error(
|
||||||
f'{_class_qualname(self)} can provide only '
|
'{0} can provide only {1} instances'.format(
|
||||||
f'{self.__class__.provided_type} instances'
|
_class_qualname(self),
|
||||||
|
self.__class__.provided_type,
|
||||||
|
),
|
||||||
)
|
)
|
||||||
self.__instantiator.set_provides(provides)
|
self.__instantiator.set_provides(provides)
|
||||||
return self
|
return self
|
||||||
|
|
Loading…
Reference in New Issue
Block a user