mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-07-28 00:49:49 +03:00
Fix deprecation warning regarding NotImplemented being evaluated in boolean context.
This commit is contained in:
parent
4b06e0a5a1
commit
1e1bce5c38
|
@ -74,7 +74,10 @@ class ErrorDetail(str):
|
||||||
def __eq__(self, other):
|
def __eq__(self, other):
|
||||||
r = super().__eq__(other)
|
r = super().__eq__(other)
|
||||||
try:
|
try:
|
||||||
return r and self.code == other.code
|
if r is not NotImplemented:
|
||||||
|
return r and self.code == other.code
|
||||||
|
else:
|
||||||
|
return self.code == other.code
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
return r
|
return r
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user