summaryrefslogtreecommitdiff
path: root/django/http/__init__.py
diff options
context:
space:
mode:
authorClaude Paroz <claude@2xlibre.net>2012-04-28 18:09:37 +0200
committerClaude Paroz <claude@2xlibre.net>2012-04-29 20:57:15 +0200
commit3904b74a3f2f92fefe1d39281ed683c52f2fef03 (patch)
tree1ae8f65371ed53df205553f41c9d0f90d1e9fee9 /django/http/__init__.py
parenteefb00f30124f775ca52258ccd8549054fe8230f (diff)
Fixed #18013 -- Use the new 'as' syntax for exceptions.
Thanks Clueless for the initial patch. Note that unittest has been purposely left out (external package only used by Python 2.6).
Diffstat (limited to 'django/http/__init__.py')
-rw-r--r--django/http/__init__.py4
1 files changed, 2 insertions, 2 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: