mirror of
https://github.com/ets-labs/python-dependency-injector.git
synced 2024-11-26 03:23:58 +03:00
Fix wiring multiple imports, issue #320
This commit is contained in:
parent
4579e35d33
commit
3c71ba4b2a
|
@ -2,6 +2,7 @@
|
|||
|
||||
import functools
|
||||
import inspect
|
||||
import importlib
|
||||
import pkgutil
|
||||
import sys
|
||||
from types import ModuleType
|
||||
|
@ -289,11 +290,11 @@ def _resolve_injections(
|
|||
|
||||
def _fetch_modules(package):
|
||||
modules = [package]
|
||||
for loader, module_name, is_pkg in pkgutil.walk_packages(
|
||||
for module_info in pkgutil.walk_packages(
|
||||
path=package.__path__,
|
||||
prefix=package.__name__ + '.',
|
||||
):
|
||||
module = loader.find_module(module_name).load_module(module_name)
|
||||
module = importlib.import_module(module_info.name)
|
||||
modules.append(module)
|
||||
return modules
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user