Import ABC from collections.abc

Signed-off-by: Karthikeyan Singaravelan <tir.karthi@gmail.com>
This commit is contained in:
Karthikeyan Singaravelan 2020-07-15 12:01:31 +00:00
parent d9dfa98819
commit 42a9a2bde9

View File

@ -20,7 +20,7 @@ import os
import copy import copy
import json import json
import logging import logging
import collections import collections.abc
from functools import lru_cache from functools import lru_cache
from pkg_resources import iter_entry_points, ResolutionError from pkg_resources import iter_entry_points, ResolutionError
@ -52,7 +52,7 @@ def map_leafs(func, mapping):
path = [] path = []
for key, val in mapping.items(): for key, val in mapping.items():
if isinstance(val, collections.Mapping): if isinstance(val, collections.abc.Mapping):
_inner(val, path + [key]) _inner(val, path + [key])
else: else:
mapping[key] = func(val, path=path+[key]) mapping[key] = func(val, path=path+[key])
@ -80,7 +80,7 @@ def update(d, u):
mapping: An updated version of d (updated by u). mapping: An updated version of d (updated by u).
""" """
for k, v in u.items(): for k, v in u.items():
if isinstance(v, collections.Mapping): if isinstance(v, collections.abc.Mapping):
r = update(d.get(k, {}), v) r = update(d.get(k, {}), v)
d[k] = r d[k] = r
else: else: