-
Notifications
You must be signed in to change notification settings - Fork 725
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes #4500, collections depreciated #4541
Conversation
Collections will be removed as of Python 3.10, Added Compatibility for versions < 3.3.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks @Metropass for this fix! 🚀
kitsune/wiki/widgets.py
Outdated
|
||
from django import forms | ||
from django.template.loader import render_to_string | ||
|
||
from kitsune.products.models import Topic | ||
from kitsune.wiki.models import Document | ||
|
||
if sys.version_info >= (3,3): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you replace the if/else
statement with:
try:
from collections.abc import Iterable
except ImportError:
from collections import Iterable
just to be consistent with our imports?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will do!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated :)
Thanks @Metropass ! |
AS of Python 3.10,
collections
will be depreciated in terms of abstract classes. Added a check if Python is >= 3.3, and importscollections.abc