diff options
Diffstat (limited to 'django/views/debug.py')
| -rw-r--r-- | django/views/debug.py | 10 |
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 |
