diff options
| author | Tim Graham <timograham@gmail.com> | 2019-01-18 10:04:29 -0500 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2019-01-30 10:19:48 -0500 |
| commit | 7e6b214ed34f5562dbd83cf54924a5b589a29715 (patch) | |
| tree | 2a2aa16c023638436bea449acdb06224bf7f33c7 /django/utils/module_loading.py | |
| parent | 5a5c77d55dc85c7e6cf910243257e408887f412a (diff) | |
Fixed #30116 -- Dropped support for Python 3.5.
Diffstat (limited to 'django/utils/module_loading.py')
| -rw-r--r-- | django/utils/module_loading.py | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/django/utils/module_loading.py b/django/utils/module_loading.py index 38119431fa..df8e65098d 100644 --- a/django/utils/module_loading.py +++ b/django/utils/module_loading.py @@ -72,11 +72,10 @@ def module_has_submodule(package, module_name): full_module_name = package_name + '.' + module_name try: return importlib_find(full_module_name, package_path) is not None - except (ImportError, AttributeError): - # When module_name is an invalid dotted path, Python raises ImportError - # (or ModuleNotFoundError in Python 3.6+). AttributeError may be raised + except (ModuleNotFoundError, AttributeError): + # When module_name is an invalid dotted path, Python raises + # ModuleNotFoundError. AttributeError is raised on PY36 (fixed in PY37) # if the penultimate part of the path is not a package. - # (https://bugs.python.org/issue30436) return False @@ -87,7 +86,7 @@ def module_dir(module): Raise ValueError otherwise, e.g. for namespace packages that are split over several directories. """ - # Convert to list because _NamespacePath does not support indexing on 3.3. + # Convert to list because _NamespacePath does not support indexing. paths = list(getattr(module, '__path__', [])) if len(paths) == 1: return paths[0] |
