summaryrefslogtreecommitdiff
path: root/django/middleware/csrf.py
diff options
context:
space:
mode:
authorJon Dufresne <jon.dufresne@gmail.com>2019-01-28 07:01:35 -0800
committerTim Graham <timograham@gmail.com>2019-01-28 11:15:06 -0500
commit7785e03ba89aafbd949191f126361fb9103cb980 (patch)
tree5776f7063604285445cfcebf6efb42fd5d063f60 /django/middleware/csrf.py
parent7444f3252757ed4384623e5afd7dcfeef3e0c74e (diff)
Fixed #30137 -- Replaced OSError aliases with the canonical OSError.
Used more specific errors (e.g. FileExistsError) as appropriate.
Diffstat (limited to 'django/middleware/csrf.py')
-rw-r--r--django/middleware/csrf.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/django/middleware/csrf.py b/django/middleware/csrf.py
index c9c27666ae..a7b0a22ba2 100644
--- a/django/middleware/csrf.py
+++ b/django/middleware/csrf.py
@@ -293,7 +293,7 @@ class CsrfViewMiddleware(MiddlewareMixin):
if request.method == "POST":
try:
request_csrf_token = request.POST.get('csrfmiddlewaretoken', '')
- except IOError:
+ except OSError:
# Handle a broken connection before we've completed reading
# the POST data. process_view shouldn't raise any
# exceptions, so we'll ignore and serve the user a 403