diff options
| author | Claude Paroz <claude@2xlibre.net> | 2017-01-07 20:13:29 +0100 |
|---|---|---|
| committer | Claude Paroz <claude@2xlibre.net> | 2017-01-22 20:08:04 +0100 |
| commit | 6e55e1d88a5c4453e25f0caf7ffb68973de5c0ba (patch) | |
| tree | 4084a5083b9e44ea90e9a119581d09efc9d41228 /django/http/multipartparser.py | |
| parent | d170c63351944fd91b2206d10f89e7ff75b53b76 (diff) | |
Refs #23919 -- Replaced six.reraise by raise
Diffstat (limited to 'django/http/multipartparser.py')
| -rw-r--r-- | django/http/multipartparser.py | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/django/http/multipartparser.py b/django/http/multipartparser.py index ff7e36e321..6a0ff2c86c 100644 --- a/django/http/multipartparser.py +++ b/django/http/multipartparser.py @@ -7,7 +7,6 @@ file upload handlers for processing. import base64 import binascii import cgi -import sys from urllib.parse import unquote from django.conf import settings @@ -17,7 +16,6 @@ from django.core.exceptions import ( from django.core.files.uploadhandler import ( SkipFile, StopFutureHandlers, StopUpload, ) -from django.utils import six from django.utils.datastructures import MultiValueDict from django.utils.encoding import force_text from django.utils.text import unescape_entities @@ -247,10 +245,9 @@ class MultiPartParser: try: chunk = base64.b64decode(stripped_chunk) - except Exception as e: + except Exception as exc: # Since this is only a chunk, any error is an unfixable error. - msg = "Could not decode base64 data: %r" % e - six.reraise(MultiPartParserError, MultiPartParserError(msg), sys.exc_info()[2]) + raise MultiPartParserError("Could not decode base64 data.") from exc for i, handler in enumerate(handlers): chunk_length = len(chunk) |
