mirror of
https://github.com/ets-labs/python-dependency-injector.git
synced 2024-11-25 19:14:00 +03:00
Improve wiring fault tolerance
This commit is contained in:
parent
fcba4cc989
commit
eacb190907
|
@ -342,7 +342,13 @@ def wire( # noqa: C901
|
||||||
_patch_fn(module, member_name, member, providers_map)
|
_patch_fn(module, member_name, member, providers_map)
|
||||||
elif inspect.isclass(member):
|
elif inspect.isclass(member):
|
||||||
cls = member
|
cls = member
|
||||||
for cls_member_name, cls_member in inspect.getmembers(cls):
|
try:
|
||||||
|
cls_members = inspect.getmembers(cls)
|
||||||
|
except Exception: # noqa
|
||||||
|
# Hotfix, see: https://github.com/ets-labs/python-dependency-injector/issues/441
|
||||||
|
continue
|
||||||
|
else:
|
||||||
|
for cls_member_name, cls_member in cls_members:
|
||||||
if _is_marker(cls_member):
|
if _is_marker(cls_member):
|
||||||
_patch_attribute(cls, cls_member_name, cls_member, providers_map)
|
_patch_attribute(cls, cls_member_name, cls_member, providers_map)
|
||||||
elif _is_method(cls_member):
|
elif _is_method(cls_member):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user