From 09e59f268619927dc22f15fed97c3ceac05ea306 Mon Sep 17 00:00:00 2001 From: Tymur Maryokhin Date: Thu, 4 Dec 2014 02:50:25 +0100 Subject: Removed custom python_2_unicode_compatible. Closes #2183 --- rest_framework/utils/mediatypes.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'rest_framework/utils') diff --git a/rest_framework/utils/mediatypes.py b/rest_framework/utils/mediatypes.py index 87b3cc6a..de2931c2 100644 --- a/rest_framework/utils/mediatypes.py +++ b/rest_framework/utils/mediatypes.py @@ -5,6 +5,7 @@ See http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.7 """ from __future__ import unicode_literals from django.http.multipartparser import parse_header +from django.utils.encoding import python_2_unicode_compatible from rest_framework import HTTP_HEADER_ENCODING @@ -43,6 +44,7 @@ def order_by_precedence(media_type_lst): return [media_types for media_types in ret if media_types] +@python_2_unicode_compatible class _MediaType(object): def __init__(self, media_type_str): if media_type_str is None: @@ -79,9 +81,6 @@ class _MediaType(object): return 3 def __str__(self): - return self.__unicode__().encode('utf-8') - - def __unicode__(self): ret = "%s/%s" % (self.main_type, self.sub_type) for key, val in self.params.items(): ret += "; %s=%s" % (key, val) -- cgit v1.2.3