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. Closes-Bug: #1936667 Change-Id: I018963cbca6ce4c4e0045be0c78f9cd2aa942d45
This commit is contained in:
parent
44b3fc3f18
commit
e4b53b1fd1
@ -11,7 +11,7 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
import collections
|
from collections import abc
|
||||||
import decimal
|
import decimal
|
||||||
import random
|
import random
|
||||||
import weakref
|
import weakref
|
||||||
@ -85,7 +85,7 @@ def safe_sort_key(value):
|
|||||||
:param value: The value to build a hash for.
|
:param value: The value to build a hash for.
|
||||||
:returns: The value sorted.
|
:returns: The value sorted.
|
||||||
"""
|
"""
|
||||||
if isinstance(value, collections.Mapping):
|
if isinstance(value, abc.Mapping):
|
||||||
return sorted(value.items())
|
return sorted(value.items())
|
||||||
return value
|
return value
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user