Skip to content

Commit

Permalink
Merge pull request #7 from sendbird/CPLAT-4620/patch_to_use_collectio…
Browse files Browse the repository at this point in the history
…ns_abc

CPLAT-4620 patch to use collections.abc in python3
  • Loading branch information
daniel-lee-sb authored Nov 12, 2024
2 parents 10f2cd3 + 3e8d627 commit e899123
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 e899123

Please sign in to comment.