@@ -1697,7 +1697,7 @@ def index_of(y):
1697
1697
1698
1698
1699
1699
def safe_first_element (obj ):
1700
- if isinstance (obj , collections .Iterator ):
1700
+ if isinstance (obj , collections .abc . Iterator ):
1701
1701
# needed to accept `array.flat` as input.
1702
1702
# np.flatiter reports as an instance of collections.Iterator
1703
1703
# but can still be indexed via [].
@@ -1714,7 +1714,7 @@ def safe_first_element(obj):
1714
1714
1715
1715
def sanitize_sequence (data ):
1716
1716
"""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
1718
1718
1719
1719
1720
1720
def normalize_kwargs (kw , alias_mapping = None , required = (), forbidden = (),
@@ -2088,9 +2088,9 @@ def _warn_external(message, category=None):
2088
2088
warnings .warn (message , category , stacklevel )
2089
2089
2090
2090
2091
- class _OrderedSet (collections .MutableSet ):
2091
+ class _OrderedSet (collections .abc . MutableSet ):
2092
2092
def __init__ (self ):
2093
- self ._od = collections .OrderedDict ()
2093
+ self ._od = collections .abc . OrderedDict ()
2094
2094
2095
2095
def __contains__ (self , key ):
2096
2096
return key in self ._od
0 commit comments