mirror of
https://github.com/django/django.git
synced 2025-12-22 00:28:16 +00:00
Refs #23919 -- Removed six.PY2/PY3 usage
Thanks Tim Graham for the review.
This commit is contained in:
parent
e63d98b7be
commit
c716fe8782
111 changed files with 305 additions and 1296 deletions
|
|
@ -7,8 +7,6 @@ except ImportError:
|
|||
|
||||
from functools import WRAPPER_ASSIGNMENTS, update_wrapper, wraps
|
||||
|
||||
from django.utils import six
|
||||
|
||||
|
||||
class classonlymethod(classmethod):
|
||||
def __get__(self, instance, cls=None):
|
||||
|
|
@ -121,13 +119,10 @@ def decorator_from_middleware(middleware_class):
|
|||
def available_attrs(fn):
|
||||
"""
|
||||
Return the list of functools-wrappable attributes on a callable.
|
||||
This is required as a workaround for http://bugs.python.org/issue3445
|
||||
This was required as a workaround for http://bugs.python.org/issue3445
|
||||
under Python 2.
|
||||
"""
|
||||
if six.PY3:
|
||||
return WRAPPER_ASSIGNMENTS
|
||||
else:
|
||||
return tuple(a for a in WRAPPER_ASSIGNMENTS if hasattr(fn, a))
|
||||
return WRAPPER_ASSIGNMENTS
|
||||
|
||||
|
||||
def make_middleware_decorator(middleware_class):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue