Use collections.abc.Iterable instead of collections.Iterable
authorAnthony Sottile <asottile@umich.edu>
Thu, 21 Oct 2021 13:30:59 +0000 (15:30 +0200)
committerGuido Günther <agx@sigxcpu.org>
Thu, 21 Oct 2021 13:30:59 +0000 (15:30 +0200)
since Python 3.10 dropped the alias.

gbp/git/args.py
gbp/rpm/linkedlist.py

index 88ad40b8bf90c3dbfd72680b82440984826005a6..27229ed7fe10f45e6054c00e5777a96de714c206 100644 (file)
@@ -18,7 +18,7 @@
 Git command argument handling helpers
 """
 
-import collections
+import collections.abc
 
 
 class GitArgs(object):
@@ -58,7 +58,7 @@ class GitArgs(object):
         for arg in args:
             if isinstance(arg, str):
                 self._args.append(arg)
-            elif isinstance(arg, collections.Iterable):
+            elif isinstance(arg, collections.abc.Iterable):
                 for i in iter(arg):
                     self._args.append(str(i))
             else:
index ca7e34c151db194e67b093d45d196c004ace7238..a56e48a1505e05a3609b21cb12ea422ef3e10d75 100644 (file)
@@ -16,7 +16,7 @@
 #    <http://www.gnu.org/licenses/>
 """Simple implementation of a doubly linked list"""
 
-import collections
+import collections.abc
 
 import gbp.log
 
@@ -68,7 +68,7 @@ class LinkedListNode(object):
         self._data = None
 
 
-class LinkedListIterator(collections.Iterator):
+class LinkedListIterator(collections.abc.Iterator):
     """Iterator for the linked list"""
 
     def __init__(self, obj):
@@ -86,7 +86,7 @@ class LinkedListIterator(collections.Iterator):
         return self.__next__()
 
 
-class LinkedList(collections.Iterable):
+class LinkedList(collections.abc.Iterable):
     """Doubly linked list"""
 
     def __init__(self):