diff options
| author | Tim Graham <timograham@gmail.com> | 2015-01-17 21:04:07 -0500 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2015-01-18 12:51:15 -0500 |
| commit | d029fafea1a1f2f257397fbcd0fa3b531e09854f (patch) | |
| tree | 1907d7b92dc7f17f07e8624469439bbab575eb8a /django/utils/module_loading.py | |
| parent | c3336e7e4f146fc62272d462288a00f8d78c1f83 (diff) | |
Removed utils.module_loading.import_by_path() per deprecation timeline; refs #21674.
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 |
