summaryrefslogtreecommitdiff
path: root/django/views/debug.py
diff options
context:
space:
mode:
authorClaude Paroz <claude@2xlibre.net>2016-12-29 16:27:49 +0100
committerClaude Paroz <claude@2xlibre.net>2017-01-18 20:18:46 +0100
commit7b2f2e74adb36a4334e83130f6abc2f79d395235 (patch)
tree313387ba6a6f1311b43cf5fb4f2576d2d6c4f805 /django/views/debug.py
parentf6acd1d271122d66de8061e75ae26137ddf02658 (diff)
Refs #23919 -- Removed six.<various>_types usage
Thanks Tim Graham and Simon Charette for the reviews.
Diffstat (limited to 'django/views/debug.py')
-rw-r--r--django/views/debug.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/django/views/debug.py b/django/views/debug.py
index 2390995b56..de8c4319bf 100644
--- a/django/views/debug.py
+++ b/django/views/debug.py
@@ -7,7 +7,7 @@ from django.http import HttpResponse, HttpResponseNotFound
from django.template import Context, Engine, TemplateDoesNotExist
from django.template.defaultfilters import force_escape, pprint
from django.urls import Resolver404, resolve
-from django.utils import lru_cache, six, timezone
+from django.utils import lru_cache, timezone
from django.utils.datastructures import MultiValueDict
from django.utils.encoding import force_bytes, force_text
from django.utils.module_loading import import_string
@@ -246,7 +246,7 @@ class ExceptionReporter(object):
self.postmortem = None
# Handle deprecated string exceptions
- if isinstance(self.exc_type, six.string_types):
+ if isinstance(self.exc_type, str):
self.exc_value = Exception('Deprecated String Exception: %r' % self.exc_type)
self.exc_type = type(self.exc_value)
@@ -263,7 +263,7 @@ class ExceptionReporter(object):
for k, v in frame['vars']:
v = pprint(v)
# The force_escape filter assume unicode, make sure that works
- if isinstance(v, six.binary_type):
+ if isinstance(v, bytes):
v = v.decode('utf-8', 'replace') # don't choke on non-utf-8 input
# Trim large blobs of data
if len(v) > 4096:
@@ -361,7 +361,7 @@ class ExceptionReporter(object):
# If we just read the source from a file, or if the loader did not
# apply tokenize.detect_encoding to decode the source into a Unicode
# string, then we should do that ourselves.
- if isinstance(source[0], six.binary_type):
+ if isinstance(source[0], bytes):
encoding = 'ascii'
for line in source[:2]:
# File coding may be specified. Match pattern from PEP-263
@@ -370,7 +370,7 @@ class ExceptionReporter(object):
if match:
encoding = match.group(1).decode('ascii')
break
- source = [six.text_type(sline, encoding, 'replace') for sline in source]
+ source = [str(sline, encoding, 'replace') for sline in source]
lower_bound = max(0, lineno - context_lines)
upper_bound = lineno + context_lines