Skip to content
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

Merged
merged 4 commits into from
Sep 29, 2020
Merged

Conversation

Metropass
Copy link
Contributor

@Metropass Metropass commented Sep 27, 2020

AS of Python 3.10, collections will be depreciated in terms of abstract classes. Added a check if Python is >= 3.3, and imports collections.abc

Collections will be removed as of Python 3.10, Added Compatibility for versions < 3.3.
@Metropass Metropass marked this pull request as ready for review September 27, 2020 20:29
Copy link
Collaborator

@akatsoulas akatsoulas left a 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! 🚀


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):
Copy link
Collaborator

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will do!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated :)

@akatsoulas
Copy link
Collaborator

Thanks @Metropass !

@akatsoulas akatsoulas merged commit 264054c into mozilla:master Sep 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants