autodiscover_modules prematurely breaks
In case one specifies multiple module arguments to module_loading.autodiscover_modules
and an application only has some of the modules, the discovery will prematurely break and not load the modules that exist.
For a simple example, assume there is an application foo
with the following structure:
foo/__init__.py
foo/module_b.py
Then, calling module_loading.autodiscover_modules('module_a', 'module_b')
will not import module_b
because the error handling logic will abort on import failure of module_a
. Error handling needs to be moved inside the for loop over args
for this to work correctly.
Change History
(5)
Triage Stage: |
Unreviewed → Accepted
|
Cc: |
info+coding@… added
|
Owner: |
changed from nobody to Markus Holtermann
|
Status: |
new → assigned
|
Resolution: |
→ fixed
|
Status: |
assigned → closed
|
I opened a pull request at https://github.com/django/django/pull/3449