Changes between Initial Version and Version 1 of Ticket #28241, comment 4


Ignore:
Timestamp:
May 26, 2017, 5:06:20 PM (7 years ago)
Author:
tkhyn

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #28241, comment 4

    initial v1  
    1 That's what I said, it works on Python 2, not on Python 3.
     1~~That's what I said, it works on Python 2, not on Python 3.~~ (sorry, I misread, replied too quickly)
    22
    3 The problem I have with that is I need to use `autodiscover_modules('path_to.my_module')`, which calls `module_has_submodule` in every app. In Python 2 it attempts to discover this module in all apps. In Python 3 it raises an exception the first time `path_to` is not a package, preventing loading any module in subsequent apps.
     3So you're saying that `module_has_submodule` should not accept dotted paths anyway. As a consequence, `autodiscover_modules` should not either ... However the dotted path feature I used and that actually worked ok for me until then with python 2.7 would not be hard to support.
     4
     5
     6The real-life problem I have with that is I need to use `autodiscover_modules('path_to.my_module')`, which calls `module_has_submodule` in every app. In Python 2 it attempts to discover this module in all apps (and consistently returns `True` or `False`). In Python 3 it raises an exception the first time `find_spec` fails, preventing loading any module in subsequent apps.
    47
    58I know one solution is to re-organize my apps structure to put `my_module` at the apps' root level, but:
Back to Top