Fix NotImplemented code path to return NotImplemented itself.

This commit is contained in:
Karthikeyan Singaravelan 2020-08-06 16:05:39 +00:00
parent 1e1bce5c38
commit c61c04a25f

View File

@ -73,11 +73,12 @@ class ErrorDetail(str):
def __eq__(self, other): def __eq__(self, other):
r = super().__eq__(other) r = super().__eq__(other)
if r is NotImplemented:
return r
try: try:
if r is not NotImplemented: return r and self.code == other.code
return r and self.code == other.code
else:
return self.code == other.code
except AttributeError: except AttributeError:
return r return r