Skip to content

Commit

Permalink
CPLAT-4620 patch to use collections.abc in python3
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-lee-sb committed Nov 12, 2024
1 parent 10f2cd3 commit 3e8d627
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
7 changes: 5 additions & 2 deletions django/core/paginator.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,12 @@ def _check_object_list_is_ordered(self):


QuerySetPaginator = Paginator # For backwards-compatibility.
try:
from collections.abc import Sequence
except ImportError:
from collections import Sequence


class Page(collections.Sequence):
class Page(Sequence):

def __init__(self, object_list, number, paginator):
self.object_list = object_list
Expand Down
8 changes: 7 additions & 1 deletion django/db/models/sql/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,13 @@
"""
import copy
import warnings
from collections import Counter, Iterator, Mapping, OrderedDict
from collections import Counter, OrderedDict
try:
from collections.abc import Iterable
from collections.abc import MutableMapping
except ImportError:
from collections import Iterable
from collections import MutableMapping
from itertools import chain, count, product
from string import ascii_uppercase

Expand Down

0 comments on commit 3e8d627

Please sign in to comment.