|
1 | 1 | import contextlib
|
2 |
| -import sys |
3 | 2 | from collections.abc import Mapping, MutableMapping
|
4 | 3 |
|
5 | 4 | from django.utils.encoding import force_str
|
@@ -29,21 +28,20 @@ def __reduce__(self):
|
29 | 28 | # but preserve the raw data.
|
30 | 29 | return (dict, (dict(self),))
|
31 | 30 |
|
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 |
47 | 45 |
|
48 | 46 |
|
49 | 47 | class ReturnList(list):
|
|
0 commit comments