Skip to content

Commit 7a698e8

Browse files
committed
Remove condition for unsupported Python versions
1 parent ed37745 commit 7a698e8

File tree

1 file changed

+14
-16
lines changed

1 file changed

+14
-16
lines changed

rest_framework/utils/serializer_helpers.py

+14-16
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import contextlib
2-
import sys
32
from collections.abc import Mapping, MutableMapping
43

54
from django.utils.encoding import force_str
@@ -29,21 +28,20 @@ def __reduce__(self):
2928
# but preserve the raw data.
3029
return (dict, (dict(self),))
3130

32-
if sys.version_info >= (3, 9):
33-
# These are basically copied from OrderedDict, with `serializer` added.
34-
def __or__(self, other):
35-
if not isinstance(other, dict):
36-
return NotImplemented
37-
new = self.__class__(self, serializer=self.serializer)
38-
new.update(other)
39-
return new
40-
41-
def __ror__(self, other):
42-
if not isinstance(other, dict):
43-
return NotImplemented
44-
new = self.__class__(other, serializer=self.serializer)
45-
new.update(self)
46-
return new
31+
# These are basically copied from OrderedDict, with `serializer` added.
32+
def __or__(self, other):
33+
if not isinstance(other, dict):
34+
return NotImplemented
35+
new = self.__class__(self, serializer=self.serializer)
36+
new.update(other)
37+
return new
38+
39+
def __ror__(self, other):
40+
if not isinstance(other, dict):
41+
return NotImplemented
42+
new = self.__class__(other, serializer=self.serializer)
43+
new.update(self)
44+
return new
4745

4846

4947
class ReturnList(list):

0 commit comments

Comments
 (0)