Skip to content

Commit

Permalink
Corrected 'name' of functions wrapped with method_decorator
Browse files Browse the repository at this point in the history
git-svn-id: http://code.djangoproject.com/svn/django/trunk@13249 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information
spookylukey committed May 13, 2010
1 parent 8e7d2d2 commit b29b0f8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion django/utils/decorators.py
Expand Up @@ -22,7 +22,7 @@ def bound_func(*args2, **kwargs2):
return wraps(func)(_wrapper) return wraps(func)(_wrapper)
update_wrapper(_dec, decorator) update_wrapper(_dec, decorator)
# Change the name to aid debugging. # Change the name to aid debugging.
_dec.__name__ = 'method_dec(%s)' % decorator.__name__ _dec.__name__ = 'method_decorator(%s)' % decorator.__name__
return _dec return _dec




Expand Down Expand Up @@ -50,13 +50,15 @@ def decorator_from_middleware(middleware_class):
""" """
return make_middleware_decorator(middleware_class)() return make_middleware_decorator(middleware_class)()



def available_attrs(fn): def available_attrs(fn):
""" """
Return the list of functools-wrappable attributes on a callable. Return the list of functools-wrappable attributes on a callable.
This is required as a workaround for http://bugs.python.org/issue3445. This is required as a workaround for http://bugs.python.org/issue3445.
""" """
return tuple(a for a in WRAPPER_ASSIGNMENTS if hasattr(fn, a)) return tuple(a for a in WRAPPER_ASSIGNMENTS if hasattr(fn, a))



def make_middleware_decorator(middleware_class): def make_middleware_decorator(middleware_class):
def _make_decorator(*m_args, **m_kwargs): def _make_decorator(*m_args, **m_kwargs):
middleware = middleware_class(*m_args, **m_kwargs) middleware = middleware_class(*m_args, **m_kwargs)
Expand Down

0 comments on commit b29b0f8

Please sign in to comment.