aboutsummaryrefslogtreecommitdiffstats
path: root/rest_framework/utils
diff options
context:
space:
mode:
authorPaul Oswald2014-08-19 10:09:48 +0900
committerPaul Oswald2014-08-19 10:09:48 +0900
commit3e93c96ece8af010185e1fe1188dd2df569d4528 (patch)
tree8a024f8c5344ac47140e29c3db7c1ca8b8a8681d /rest_framework/utils
parent192201d5840f13c8b96f44fdce4645edeb653f0f (diff)
downloaddjango-rest-framework-3e93c96ece8af010185e1fe1188dd2df569d4528.tar.bz2
replace unicode call with force_text
Diffstat (limited to 'rest_framework/utils')
-rw-r--r--rest_framework/utils/formatting.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/rest_framework/utils/formatting.py b/rest_framework/utils/formatting.py
index 2b3cbc95..40bced5f 100644
--- a/rest_framework/utils/formatting.py
+++ b/rest_framework/utils/formatting.py
@@ -5,6 +5,8 @@ from __future__ import unicode_literals
from django.utils.html import escape
from django.utils.safestring import mark_safe
+from django.utils.encoding import force_text
+
from rest_framework.compat import apply_markdown
import re
@@ -28,7 +30,7 @@ def dedent(content):
as it fails to dedent multiline docstrings that include
unindented text on the initial line.
"""
- content = unicode(content)
+ content = force_text(content)
whitespace_counts = [len(line) - len(line.lstrip(' '))
for line in content.splitlines()[1:] if line.lstrip()]