jamespacileo/django-pure-pagination

python 3.10 AttributeError: module 'collections' has no attribute 'Iterable'

Opened this issue · 3 comments

Got an error when using python 3.10:
I had to do the following change in order to have it back working in my project:

python3.10/site-packages/pure_pagination/paginator.py:
replace the first line "import collections" into:

try: # Python 3.10
    from collections.abc import Iterable
except ImportError:
    from collections import Iterable

AND line 109 " elif isinstance(result, collections.Iterable):" into
elif isinstance(result, Iterable):

I have some question.
I can’t find :
elif isinstance(result, Iterable):

please show your
python3.10/site-packages/pure_pagination/paginator.py ?

thanks

hi,I have a similar problem

python 3.10
Django 4.0.5

Error during template rendering
In template ~\templates\pure_pagination\pagination.html, error at line 11

Invalid block tag on line 11: 'ifequal', expected 'elif','else' or 'endif'. Did you forget to register or load this tag?

10 {% if page %}
11 {% ifequal page page_obj.number %}
12

  • {{ page }}
  • I have some question. I can’t find : elif isinstance(result, Iterable):

    please show your python3.10/site-packages/pure_pagination/paginator.py ?

    thanks

    Obviously you cant find it in the code as it needs to be changed into it. Read carefully ;-)