Copy list in a way that is both Py2 and Py3 compatible.

This commit is contained in:
Diana Huang
2019-12-12 12:17:56 -05:00
parent a8ea9844dc
commit 40c98fb22b

View File

@@ -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)