Fix the issue

This commit is contained in:
Roman Mogylatov 2020-07-22 11:46:58 -04:00
parent cfbed20a05
commit 16fbb37694
4 changed files with 3079 additions and 2978 deletions

View File

@ -915,12 +915,12 @@ struct __pyx_obj_19dependency_injector_9providers_Delegate {
*
*
* cdef class Dependency(Provider): # <<<<<<<<<<<<<<
* cdef type __instance_of
* cdef object __instance_of
*
*/
struct __pyx_obj_19dependency_injector_9providers_Dependency {
struct __pyx_obj_19dependency_injector_9providers_Provider __pyx_base;
PyTypeObject *__pyx___instance_of;
PyObject *__pyx___instance_of;
};
@ -1485,7 +1485,7 @@ static struct __pyx_vtabstruct_19dependency_injector_9providers_Delegate *__pyx_
*
*
* cdef class Dependency(Provider): # <<<<<<<<<<<<<<
* cdef type __instance_of
* cdef object __instance_of
*
*/

File diff suppressed because it is too large Load Diff

View File

@ -28,7 +28,7 @@ cdef class Delegate(Provider):
cdef class Dependency(Provider):
cdef type __instance_of
cdef object __instance_of
cdef class ExternalDependency(Dependency):

View File

@ -419,8 +419,16 @@ cdef class Dependency(Provider):
:type: type
"""
def __init__(self, type instance_of=object):
def __init__(self, object instance_of=object):
"""Initializer."""
if not isinstance(instance_of, CLASS_TYPES):
raise TypeError(
'Argument \'instance_of\' has incorrect type (expected {0}, got {1}))'.format(
CLASS_TYPES,
instance_of,
)
)
self.__instance_of = instance_of
super(Dependency, self).__init__()