Skip to content

Commit fd8adb3

Browse files
Refactor short names in exceptions (#8585)
1 parent 224168a commit fd8adb3

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

rest_framework/exceptions.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""
22
Handled exceptions raised by REST framework.
33
4-
In addition Django's built in 403 and 404 exceptions are handled.
4+
In addition, Django's built in 403 and 404 exceptions are handled.
55
(`django.http.Http404` and `django.core.exceptions.PermissionDenied`)
66
"""
77
import math
@@ -72,19 +72,19 @@ def __new__(cls, string, code=None):
7272
return self
7373

7474
def __eq__(self, other):
75-
r = super().__eq__(other)
76-
if r is NotImplemented:
75+
result = super().__eq__(other)
76+
if result is NotImplemented:
7777
return NotImplemented
7878
try:
79-
return r and self.code == other.code
79+
return result and self.code == other.code
8080
except AttributeError:
81-
return r
81+
return result
8282

8383
def __ne__(self, other):
84-
r = self.__eq__(other)
85-
if r is NotImplemented:
84+
result = self.__eq__(other)
85+
if result is NotImplemented:
8686
return NotImplemented
87-
return not r
87+
return not result
8888

8989
def __repr__(self):
9090
return 'ErrorDetail(string=%r, code=%r)' % (

0 commit comments

Comments
 (0)