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

commented Aug 19, 2019

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

Avoid DeprecationWarning about ABC in Python 3.x
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

This comment has been minimized.

Copy link
Member

commented Aug 20, 2019

Thanks!

@sloria sloria merged commit ac89039 into marshmallow-code:2.x-line Aug 20, 2019

8 checks passed

marshmallow-code.marshmallow Build #20190819.5 succeeded
Details
marshmallow-code.marshmallow (tox_linux docs) tox_linux docs succeeded
Details
marshmallow-code.marshmallow (tox_linux lint) tox_linux lint succeeded
Details
marshmallow-code.marshmallow (tox_linux py27) tox_linux py27 succeeded
Details
marshmallow-code.marshmallow (tox_linux py34) tox_linux py34 succeeded
Details
marshmallow-code.marshmallow (tox_linux py35) tox_linux py35 succeeded
Details
marshmallow-code.marshmallow (tox_linux py36) tox_linux py36 succeeded
Details
marshmallow-code.marshmallow (tox_linux py37) tox_linux py37 succeeded
Details

@nicktimko nicktimko deleted the nicktimko:patch-1 branch Aug 20, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.