summaryrefslogtreecommitdiff
path: root/tests/file_uploads
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2017-01-19 08:50:28 -0500
committerGitHub <noreply@github.com>2017-01-19 08:50:28 -0500
commit5320fa77c3b2bc02ac232c3e0f5279d99a528e6a (patch)
tree34da130e2b96cdedecff09122e20362f312a1b28 /tests/file_uploads
parent7d200949968002d2c2b4390953e8bda7153a49c9 (diff)
downloaddjango-5320fa77c3b2bc02ac232c3e0f5279d99a528e6a.tar.gz
Refs #23919 -- Removed obsolete contextlib.closing() calls (for Python 2).
Diffstat (limited to 'tests/file_uploads')
-rw-r--r--tests/file_uploads/views.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/tests/file_uploads/views.py b/tests/file_uploads/views.py
index c4166087ac..789cc2a365 100644
--- a/tests/file_uploads/views.py
+++ b/tests/file_uploads/views.py
@@ -1,4 +1,3 @@
-import contextlib
import hashlib
import json
import os
@@ -98,7 +97,7 @@ def file_upload_echo_content(request):
Simple view to echo back the content of uploaded files for tests.
"""
def read_and_close(f):
- with contextlib.closing(f):
+ with f:
return f.read().decode('utf-8')
r = {k: read_and_close(f) for k, f in request.FILES.items()}
return HttpResponse(json.dumps(r))