diff --git a/rest_framework/exceptions.py b/rest_framework/exceptions.py index 345a405248..943dcc88c3 100644 --- a/rest_framework/exceptions.py +++ b/rest_framework/exceptions.py @@ -73,6 +73,8 @@ def __new__(cls, string, code=None): def __eq__(self, other): r = super().__eq__(other) + if r is NotImplemented: + return NotImplemented try: return r and self.code == other.code except AttributeError: