diff options
| author | Tom Christie | 2014-10-01 13:09:14 +0100 | 
|---|---|---|
| committer | Tom Christie | 2014-10-01 13:09:14 +0100 | 
| commit | 381771731f48c75e7d5951e353049cceec386512 (patch) | |
| tree | bc426b11d4ba33cbbb2063e3393f8855c7841fd8 /rest_framework/compat.py | |
| parent | bb2222963f527638ed2bc9a817415102312e12e0 (diff) | |
| download | django-rest-framework-381771731f48c75e7d5951e353049cceec386512.tar.bz2 | |
Use six.text_type instead of str everywhere
Diffstat (limited to 'rest_framework/compat.py')
| -rw-r--r-- | rest_framework/compat.py | 9 | 
1 files changed, 5 insertions, 4 deletions
diff --git a/rest_framework/compat.py b/rest_framework/compat.py index 89af9b48..3993cee6 100644 --- a/rest_framework/compat.py +++ b/rest_framework/compat.py @@ -5,11 +5,12 @@ versions of django/python, and compatibility wrappers around optional packages.  # flake8: noqa  from __future__ import unicode_literals -import django -import inspect +  from django.core.exceptions import ImproperlyConfigured  from django.conf import settings  from django.utils import six +import django +import inspect  # Handle django.utils.encoding rename in 1.5 onwards. @@ -177,12 +178,12 @@ class RequestFactory(DjangoRequestFactory):          r = {              'PATH_INFO':      self._get_path(parsed),              'QUERY_STRING':   force_text(parsed[4]), -            'REQUEST_METHOD': str(method), +            'REQUEST_METHOD': six.text_type(method),          }          if data:              r.update({                  'CONTENT_LENGTH': len(data), -                'CONTENT_TYPE':   str(content_type), +                'CONTENT_TYPE':   six.text_type(content_type),                  'wsgi.input':     FakePayload(data),              })          elif django.VERSION <= (1, 4):  | 
