Skip to content

Commit e3e7ed6

Browse files
committed
MAINT: use collections.abc for 3.7
1 parent 23420a4 commit e3e7ed6

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/matplotlib/cbook/__init__.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -1697,7 +1697,7 @@ def index_of(y):
16971697

16981698

16991699
def safe_first_element(obj):
1700-
if isinstance(obj, collections.Iterator):
1700+
if isinstance(obj, collections.abc.Iterator):
17011701
# needed to accept `array.flat` as input.
17021702
# np.flatiter reports as an instance of collections.Iterator
17031703
# but can still be indexed via [].
@@ -1714,7 +1714,7 @@ def safe_first_element(obj):
17141714

17151715
def sanitize_sequence(data):
17161716
"""Converts dictview object to list"""
1717-
return list(data) if isinstance(data, collections.MappingView) else data
1717+
return list(data) if isinstance(data, collections.abc.MappingView) else data
17181718

17191719

17201720
def normalize_kwargs(kw, alias_mapping=None, required=(), forbidden=(),
@@ -2088,9 +2088,9 @@ def _warn_external(message, category=None):
20882088
warnings.warn(message, category, stacklevel)
20892089

20902090

2091-
class _OrderedSet(collections.MutableSet):
2091+
class _OrderedSet(collections.abc.MutableSet):
20922092
def __init__(self):
2093-
self._od = collections.OrderedDict()
2093+
self._od = collections.abc.OrderedDict()
20942094

20952095
def __contains__(self, key):
20962096
return key in self._od

0 commit comments

Comments
 (0)