From 40c98fb22ba5341e5e1a49ca6f8168424bb728c2 Mon Sep 17 00:00:00 2001 From: Diana Huang Date: Thu, 12 Dec 2019 12:17:56 -0500 Subject: [PATCH] Copy list in a way that is both Py2 and Py3 compatible. --- common/djangoapps/util/cache.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/djangoapps/util/cache.py b/common/djangoapps/util/cache.py index 1305ed63a7..9dee55828f 100644 --- a/common/djangoapps/util/cache.py +++ b/common/djangoapps/util/cache.py @@ -79,7 +79,7 @@ def cache_if_anonymous(*get_parameters): if response: # A hack to ensure that the response data is a valid text type for both Python 2 and 3. - response_content = response._container.copy() # pylint: disable=protected-member + response_content = list(response._container) # pylint: disable=protected-member response.content = b'' for item in response_content: response.write(item)