Changes between Initial Version and Version 2 of Ticket #28241
- Timestamp:
- May 25, 2017, 11:05:58 PM (7 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #28241
- Property Summary module_has_submodule behavior in Python 3 → module_has_submodule raises exceptions in Python 3
-
Ticket #28241 – Description
initial v2 11 11 >>> from django.utils.module_loading import module_has_submodule 12 12 >>> from django.contrib import contenttypes 13 >>> module_has_submodule( 'invalid_module.submodule')13 >>> module_has_submodule(contenttypes, 'invalid_module.submodule') 14 14 False 15 >>> module_has_submodule( 'checks')15 >>> module_has_submodule(contenttypes, 'checks') 16 16 True 17 >>> module_has_submodule( 'checks.submodule')17 >>> module_has_submodule(contenttypes, 'checks.submodule') 18 18 False 19 19 }}} … … 25 25 >>> from django.utils.module_loading import module_has_submodule 26 26 >>> from django.contrib import contenttypes 27 >>> module_has_submodule( 'invalid_module.submodule')27 >>> module_has_submodule(contenttypes, 'invalid_module.submodule') 28 28 File "<console>", line 1, in <module> 29 29 File "d:\dev\.env\buildout\eggs\django-1.11.1-py3.6.egg\django\utils\module_loading.py", line 79, in module_has_submodule … … 32 32 parent = __import__(parent_name, fromlist=['__path__']) 33 33 ModuleNotFoundError: No module named 'django.contrib.contenttypes.invalid_module' 34 >>> module_has_submodule( 'checks')34 >>> module_has_submodule(contenttypes, 'checks') 35 35 True 36 >>> module_has_submodule( 'checks.submodule')36 >>> module_has_submodule(contenttypes, 'checks.submodule') 37 37 File "<console>", line 1, in <module> 38 38 File "d:\dev\.env\buildout\eggs\django-1.11.1-py3.6.egg\django\utils\module_loading.py", line 79, in module_has_submodule