diff options
Diffstat (limited to 'django/http')
| -rw-r--r-- | django/http/__init__.py | 4 | ||||
| -rw-r--r-- | django/http/multipartparser.py | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/django/http/__init__.py b/django/http/__init__.py index 577f1d8170..382f3c3f17 100644 --- a/django/http/__init__.py +++ b/django/http/__init__.py @@ -290,7 +290,7 @@ class HttpRequest(object): raise Exception("You cannot access body after reading from request's data stream") try: self._body = self.read() - except IOError, e: + except IOError as e: raise UnreadablePostError, e, sys.exc_traceback self._stream = StringIO(self._body) return self._body @@ -556,7 +556,7 @@ class HttpResponse(object): if isinstance(value, unicode): try: value = value.encode('us-ascii') - except UnicodeError, e: + except UnicodeError as e: e.reason += ', HTTP response headers must be in US-ASCII format' raise else: diff --git a/django/http/multipartparser.py b/django/http/multipartparser.py index 477a08c05a..024e11a09c 100644 --- a/django/http/multipartparser.py +++ b/django/http/multipartparser.py @@ -196,7 +196,7 @@ class MultiPartParser(object): # We only special-case base64 transfer encoding try: chunk = str(chunk).decode('base64') - except Exception, e: + except Exception as e: # Since this is only a chunk, any error is an unfixable error. raise MultiPartParserError("Could not decode base64 data: %r" % e) @@ -209,7 +209,7 @@ class MultiPartParser(object): # If the chunk received by the handler is None, then don't continue. break - except SkipFile, e: + except SkipFile: # Just use up the rest of this file... exhaust(field_stream) else: @@ -218,7 +218,7 @@ class MultiPartParser(object): else: # If this is neither a FIELD or a FILE, just exhaust the stream. exhaust(stream) - except StopUpload, e: + except StopUpload as e: if not e.connection_reset: exhaust(self._input_data) else: |
