Skip to content

Commit 7fbdcff

Browse files
committed
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
1 parent ba5edba commit 7fbdcff

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

rest_auth/tests.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def send_request(self, request_method, *args, **kwargs):
4949

5050
self.response = request_func(*args, **kwargs)
5151
is_json = bool(
52-
filter(lambda x: 'json' in x, self.response._headers['content-type']))
52+
[x for x in self.response._headers['content-type'] if 'json' in x])
5353
if is_json and self.response.content:
5454
self.response.json = json.loads(self.response.content)
5555
else:

0 commit comments

Comments
 (0)