Changes between Initial Version and Version 2 of Ticket #28241


Ignore:
Timestamp:
May 25, 2017, 11:05:58 PM (7 years ago)
Author:
tkhyn
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #28241

    • Property Summary module_has_submodule behavior in Python 3module_has_submodule raises exceptions in Python 3
  • Ticket #28241 – Description

    initial v2  
    1111>>> from django.utils.module_loading import module_has_submodule
    1212>>> from django.contrib import contenttypes
    13 >>> module_has_submodule('invalid_module.submodule')
     13>>> module_has_submodule(contenttypes, 'invalid_module.submodule')
    1414False
    15 >>> module_has_submodule('checks')
     15>>> module_has_submodule(contenttypes, 'checks')
    1616True
    17 >>> module_has_submodule('checks.submodule')
     17>>> module_has_submodule(contenttypes, 'checks.submodule')
    1818False
    1919}}}
     
    2525>>> from django.utils.module_loading import module_has_submodule
    2626>>> from django.contrib import contenttypes
    27 >>> module_has_submodule('invalid_module.submodule')
     27>>> module_has_submodule(contenttypes, 'invalid_module.submodule')
    2828  File "<console>", line 1, in <module>
    2929  File "d:\dev\.env\buildout\eggs\django-1.11.1-py3.6.egg\django\utils\module_loading.py", line 79, in module_has_submodule
     
    3232    parent = __import__(parent_name, fromlist=['__path__'])
    3333ModuleNotFoundError: No module named 'django.contrib.contenttypes.invalid_module'
    34 >>> module_has_submodule('checks')
     34>>> module_has_submodule(contenttypes, 'checks')
    3535True
    36 >>> module_has_submodule('checks.submodule')
     36>>> module_has_submodule(contenttypes, 'checks.submodule')
    3737  File "<console>", line 1, in <module>
    3838  File "d:\dev\.env\buildout\eggs\django-1.11.1-py3.6.egg\django\utils\module_loading.py", line 79, in module_has_submodule
Back to Top