-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
MAINT: use collections.abc for 3.7 #11733
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
Conversation
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! After reverting the change to OrderedDict
this will be good.
lib/matplotlib/cbook/__init__.py
Outdated
def __init__(self): | ||
self._od = collections.OrderedDict() | ||
self._od = collections.abc.OrderedDict() |
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.
OrderedDict is not in abc
Lets see if this works. |
lib/matplotlib/cbook/__init__.py
Outdated
@@ -1714,7 +1715,7 @@ def safe_first_element(obj): | |||
|
|||
def sanitize_sequence(data): | |||
"""Converts dictview object to list""" | |||
return list(data) if isinstance(data, collections.MappingView) else data | |||
return list(data) if isinstance(data, collections.abc.MappingView) else data |
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.
need a line break here, the style checker is not happy
@tacaswell I think avoiding a warning on Py3.7 makes this worth milestoning for mpl3.0? |
OSX failure is irrelevant and will be "fixed" (or worked around, at least) by #11763. Allowing myself to remilestone to 3.0 per above. |
Thanks for the PR. |
@meeseeksdev backport to v2.2.x |
There seem to be a conflict, please backport manually |
MAINT: use collections.abc for 3.7 Conflicts: lib/matplotlib/cbook/__init__.py Added try-except block to handle py2 case
scipy is getting some issues when trying to test on Python 3.7 because of a DeprecationWarning:
DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working
This PR just changes a few instances of
collections.X
intocollections.abc.X
.