Skip to content

Commit dd3b47c

Browse files
committed
Merge pull request #4025 from dnit/master
type('') to str
2 parents 3d3b064 + 09aa8f7 commit dd3b47c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

rest_framework/authentication.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
from django.contrib.auth import authenticate, get_user_model
99
from django.middleware.csrf import CsrfViewMiddleware
10+
from django.utils.six import string_types
1011
from django.utils.translation import ugettext_lazy as _
1112

1213
from rest_framework import HTTP_HEADER_ENCODING, exceptions
@@ -19,7 +20,7 @@ def get_authorization_header(request):
1920
Hide some test client ickyness where the header can be unicode.
2021
"""
2122
auth = request.META.get('HTTP_AUTHORIZATION', b'')
22-
if isinstance(auth, type('')):
23+
if isinstance(auth, string_types):
2324
# Work around django test client oddness
2425
auth = auth.encode(HTTP_HEADER_ENCODING)
2526
return auth

0 commit comments

Comments
 (0)