summaryrefslogtreecommitdiff
path: root/django/core/files/base.py
diff options
context:
space:
mode:
Diffstat (limited to 'django/core/files/base.py')
-rw-r--r--django/core/files/base.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/django/core/files/base.py b/django/core/files/base.py
index dd07bc959a..df29c94eee 100644
--- a/django/core/files/base.py
+++ b/django/core/files/base.py
@@ -2,7 +2,6 @@ import os
from io import BytesIO, StringIO, UnsupportedOperation
from django.core.files.utils import FileProxyMixin
-from django.utils import six
from django.utils.encoding import force_str, force_text
@@ -140,7 +139,7 @@ class ContentFile(File):
A File-like object that takes just raw content, rather than an actual file.
"""
def __init__(self, content, name=None):
- stream_class = StringIO if isinstance(content, six.text_type) else BytesIO
+ stream_class = StringIO if isinstance(content, str) else BytesIO
super(ContentFile, self).__init__(stream_class(content), name=name)
self.size = len(content)
@@ -164,18 +163,18 @@ def endswith_cr(line):
"""
Return True if line (a text or byte string) ends with '\r'.
"""
- return line.endswith('\r' if isinstance(line, six.text_type) else b'\r')
+ return line.endswith('\r' if isinstance(line, str) else b'\r')
def endswith_lf(line):
"""
Return True if line (a text or byte string) ends with '\n'.
"""
- return line.endswith('\n' if isinstance(line, six.text_type) else b'\n')
+ return line.endswith('\n' if isinstance(line, str) else b'\n')
def equals_lf(line):
"""
Return True if line (a text or byte string) equals '\n'.
"""
- return line == ('\n' if isinstance(line, six.text_type) else b'\n')
+ return line == ('\n' if isinstance(line, str) else b'\n')