mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-01-24 00:04:16 +03:00
replace unicode call with force_text
This commit is contained in:
parent
192201d584
commit
3e93c96ece
|
@ -5,6 +5,8 @@ from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.utils.html import escape
|
from django.utils.html import escape
|
||||||
from django.utils.safestring import mark_safe
|
from django.utils.safestring import mark_safe
|
||||||
|
from django.utils.encoding import force_text
|
||||||
|
|
||||||
from rest_framework.compat import apply_markdown
|
from rest_framework.compat import apply_markdown
|
||||||
import re
|
import re
|
||||||
|
|
||||||
|
@ -28,7 +30,7 @@ def dedent(content):
|
||||||
as it fails to dedent multiline docstrings that include
|
as it fails to dedent multiline docstrings that include
|
||||||
unindented text on the initial line.
|
unindented text on the initial line.
|
||||||
"""
|
"""
|
||||||
content = unicode(content)
|
content = force_text(content)
|
||||||
whitespace_counts = [len(line) - len(line.lstrip(' '))
|
whitespace_counts = [len(line) - len(line.lstrip(' '))
|
||||||
for line in content.splitlines()[1:] if line.lstrip()]
|
for line in content.splitlines()[1:] if line.lstrip()]
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user