diff options
| author | Tom Christie | 2015-02-09 17:19:22 +0000 | 
|---|---|---|
| committer | Tom Christie | 2015-02-09 17:19:22 +0000 | 
| commit | 54d82f59ed8a5d2ad4c679680dc52b8a94831d50 (patch) | |
| tree | 4829a813af5fcaa72f26f27ce21a8848ad70a92d /rest_framework/request.py | |
| parent | d13c807616030b285589cec2fddf4e34a8e22b4a (diff) | |
| download | django-rest-framework-54d82f59ed8a5d2ad4c679680dc52b8a94831d50.tar.bz2 | |
Py3 compat fix
Diffstat (limited to 'rest_framework/request.py')
| -rw-r--r-- | rest_framework/request.py | 8 | 
1 files changed, 4 insertions, 4 deletions
| diff --git a/rest_framework/request.py b/rest_framework/request.py index 38fcf9c0..c4de9424 100644 --- a/rest_framework/request.py +++ b/rest_framework/request.py @@ -12,9 +12,9 @@ from __future__ import unicode_literals  from django.conf import settings  from django.http import QueryDict  from django.http.multipartparser import parse_header +from django.utils import six  from django.utils.datastructures import MultiValueDict  from django.utils.datastructures import MergeDict as DjangoMergeDict -from django.utils.six import BytesIO  from rest_framework import HTTP_HEADER_ENCODING  from rest_framework import exceptions  from rest_framework.settings import api_settings @@ -363,7 +363,7 @@ class Request(object):          elif hasattr(self._request, 'read'):              self._stream = self._request          else: -            self._stream = BytesIO(self.raw_post_data) +            self._stream = six.BytesIO(self.raw_post_data)      def _perform_form_overloading(self):          """ @@ -405,7 +405,7 @@ class Request(object):              self._CONTENTTYPE_PARAM in self._data          ):              self._content_type = self._data[self._CONTENTTYPE_PARAM] -            self._stream = BytesIO(self._data[self._CONTENT_PARAM].encode(self.parser_context['encoding'])) +            self._stream = six.BytesIO(self._data[self._CONTENT_PARAM].encode(self.parser_context['encoding']))              self._data, self._files, self._full_data = (Empty, Empty, Empty)      def _parse(self): @@ -498,4 +498,4 @@ class Request(object):              try:                  return getattr(self._request, attr)              except AttributeError: -                raise info[0], info[1], info[2].tb_next +                six.reraise(info[0], info[1], info[2].tb_next) | 
