summaryrefslogtreecommitdiff
path: root/tests/handlers
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2017-09-07 08:16:21 -0400
committerGitHub <noreply@github.com>2017-09-07 08:16:21 -0400
commit6e4c6281dbb7ee12bcdc22620894edb4e9cf623f (patch)
tree1c21218d4b6f00c499f18943d5190ebe7b5248c9 /tests/handlers
parent8b2515a450ef376b9205029090af0a79c8341bd7 (diff)
downloaddjango-6e4c6281dbb7ee12bcdc22620894edb4e9cf623f.tar.gz
Reverted "Fixed #27818 -- Replaced try/except/pass with contextlib.suppress()."
This reverts commit 550cb3a365dee4edfdd1563224d5304de2a57fda because try/except performs better.
Diffstat (limited to 'tests/handlers')
-rw-r--r--tests/handlers/views.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/handlers/views.py b/tests/handlers/views.py
index 3c1fa5b802..22b94de3b9 100644
--- a/tests/handlers/views.py
+++ b/tests/handlers/views.py
@@ -1,12 +1,12 @@
-from contextlib import suppress
-
from django.core.exceptions import SuspiciousOperation
from django.db import connection, transaction
from django.http import HttpResponse, StreamingHttpResponse
from django.views.decorators.csrf import csrf_exempt
-with suppress(ImportError): # Python < 3.5
+try:
from http import HTTPStatus
+except ImportError: # Python < 3.5
+ pass
def regular(request):