Switch to collections.abc.MutableMapping
collections.MutableMapping has been deprecated since Python 3.3 and is removed in Python 3.10. The functionality is identical. Change-Id: I77d7adfb4a1e787f9599354061514a7394a3a59b Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
This commit is contained in:
parent
85257b5673
commit
089f748a18
@ -9,7 +9,8 @@
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
import collections
|
||||
|
||||
import collections.abc
|
||||
|
||||
from oslo_policy import policy
|
||||
import pecan
|
||||
@ -163,7 +164,7 @@ def flatten(d, parent_key=''):
|
||||
items = []
|
||||
for k, v in d.items():
|
||||
new_key = parent_key + '.' + k if parent_key else k
|
||||
if isinstance(v, collections.MutableMapping):
|
||||
if isinstance(v, collections.abc.MutableMapping):
|
||||
items.extend(flatten(v, new_key).items())
|
||||
else:
|
||||
items.append((new_key, v))
|
||||
|
Loading…
x
Reference in New Issue
Block a user