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

Avoid DeprecationWarning about ABC in Python 3.x #1354

Merged
merged 1 commit into from
Aug 20, 2019

Conversation

nicktimko
Copy link
Contributor

Python 3.x complains about the collections.Mapping vs collections.abc.Mapping. There is already a shim for it in marshmallow.compat, so switched to using that.

/usr/lib/python3.7/site-packages/marshmallow/marshalling.py:253: DeprecationWarning: Using or importing the ABCs from collections instead of from collections.abc is deprecated, and in 3.8 it will stop working

    if not isinstance(data, collections.Mapping):

Though I poked at the collections.Mapping in 3.8 and it said "...is deprecated since Python 3.3,and in 3.9 it will stop working", so it's maybe not as critical, but it removes nagging. See python/cpython#13409

Python 3.x complains about the `collections.Mapping` vs `collections.abc.Mapping`. There is already a shim for it in `marshmallow.compat`, so switched to using that.
@sloria
Copy link
Member

sloria commented Aug 20, 2019

Thanks!

@sloria sloria merged commit ac89039 into marshmallow-code:2.x-line Aug 20, 2019
@nicktimko nicktimko deleted the patch-1 branch August 20, 2019 14:26
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