Skip to content

Commit 4f209fc

Browse files
dusktreaderTucker Beck
authored andcommitted
Fixed super class handling for other python interpreters
1 parent d48ab4d commit 4f209fc

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

pytest_flask/plugin.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,13 @@ def __eq__(self, other):
3434
status_code = int(other)
3535
return self.status_code == status_code
3636
except:
37-
return super(JSONResponse, self).__eq__(other)
37+
super_class = super(JSONResponse, self)
38+
try:
39+
super_eq = getattr(super_class, '__eq__')
40+
except AttributeError:
41+
super_eq = object.__eq__
42+
finally:
43+
return super_eq(other)
3844

3945

4046
def pytest_assertrepr_compare(op, left, right):

0 commit comments

Comments
 (0)