diff --git a/django/utils/decorators.py b/django/utils/decorators.py index f5f3be2f16..f0998b8bd1 100644 --- a/django/utils/decorators.py +++ b/django/utils/decorators.py @@ -2,7 +2,7 @@ # For backwards compatibility in Django 2.0. from contextlib import ContextDecorator # noqa -from functools import WRAPPER_ASSIGNMENTS, partial, update_wrapper, wraps +from functools import partial, update_wrapper, wraps class classonlymethod(classmethod): @@ -113,16 +113,6 @@ def decorator_from_middleware(middleware_class): return make_middleware_decorator(middleware_class)() -# Unused, for backwards compatibility in Django 2.0. -def available_attrs(fn): - """ - Return the list of functools-wrappable attributes on a callable. - This was required as a workaround for https://bugs.python.org/issue3445 - under Python 2. - """ - return WRAPPER_ASSIGNMENTS - - def make_middleware_decorator(middleware_class): def _make_decorator(*m_args, **m_kwargs): middleware = middleware_class(*m_args, **m_kwargs) diff --git a/docs/releases/3.0.txt b/docs/releases/3.0.txt index 14fa129bf2..7801db12f2 100644 --- a/docs/releases/3.0.txt +++ b/docs/releases/3.0.txt @@ -254,6 +254,9 @@ Django 3.0, we're removing these APIs at this time. * ``django.utils.lru_cache.lru_cache()`` - Alias of :func:`functools.lru_cache`. +* ``django.utils.decorators.available_attrs()`` - This function returns + ``functools.WRAPPER_ASSIGNMENTS``. + Miscellaneous -------------