Replace deprecated import of ABCs from collections
ABCs in collections should be imported from collections.abc and direct import from collections is deprecated since Python 3.3. Change-Id: Ic4c1cb4d9ce7595d1e684c26229a5148b5f4befa
This commit is contained in:
@@ -14,7 +14,7 @@
|
||||
# under the License.
|
||||
"""I totally stole most of this from melange, thx guys!!!"""
|
||||
|
||||
import collections
|
||||
from collections import abc
|
||||
import inspect
|
||||
import os
|
||||
import shutil
|
||||
@@ -331,7 +331,7 @@ def unpack_singleton(container):
|
||||
def is_collection(item):
|
||||
"""Return True is a given item is an iterable collection, but not a string.
|
||||
"""
|
||||
return (isinstance(item, collections.Iterable) and
|
||||
return (isinstance(item, abc.Iterable) and
|
||||
not isinstance(item, (bytes, str)))
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user