From 7fbdcff5e03999421e50e2196476cd69e1933284 Mon Sep 17 00:00:00 2001 From: Matt d'Entremont Date: Mon, 26 Oct 2015 10:13:27 -0300 Subject: [PATCH] Alter a statement to make it python3 compatible - In python 3, filter returns an iterator instead of a list - Thus bool(filter(...)) always evaluated to true on python3 - Convert the filter to a list comprehension to ensure it evaluated as expected on python 3 --- rest_auth/tests.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rest_auth/tests.py b/rest_auth/tests.py index b137313..d3204c8 100644 --- a/rest_auth/tests.py +++ b/rest_auth/tests.py @@ -49,7 +49,7 @@ class BaseAPITestCase(object): self.response = request_func(*args, **kwargs) is_json = bool( - filter(lambda x: 'json' in x, self.response._headers['content-type'])) + [x for x in self.response._headers['content-type'] if 'json' in x]) if is_json and self.response.content: self.response.json = json.loads(self.response.content) else: