diff options
Diffstat (limited to 'django/utils/module_loading.py')
| -rw-r--r-- | django/utils/module_loading.py | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/django/utils/module_loading.py b/django/utils/module_loading.py index cd0c8bc5cc..a4e255842d 100644 --- a/django/utils/module_loading.py +++ b/django/utils/module_loading.py @@ -4,11 +4,8 @@ import copy from importlib import import_module import os import sys -import warnings -from django.core.exceptions import ImproperlyConfigured from django.utils import six -from django.utils.deprecation import RemovedInDjango19Warning def import_string(dotted_path): @@ -32,24 +29,6 @@ def import_string(dotted_path): six.reraise(ImportError, ImportError(msg), sys.exc_info()[2]) -def import_by_path(dotted_path, error_prefix=''): - """ - Import a dotted module path and return the attribute/class designated by the - last name in the path. Raise ImproperlyConfigured if something goes wrong. - """ - warnings.warn( - 'import_by_path() has been deprecated. Use import_string() instead.', - RemovedInDjango19Warning, stacklevel=2) - try: - attr = import_string(dotted_path) - except ImportError as e: - msg = '%sError importing module %s: "%s"' % ( - error_prefix, dotted_path, e) - six.reraise(ImproperlyConfigured, ImproperlyConfigured(msg), - sys.exc_info()[2]) - return attr - - def autodiscover_modules(*args, **kwargs): """ Auto-discover INSTALLED_APPS modules and fail silently when |
