From 594d013d95c2a57dce8ec882185b5f3b25fd9559 Mon Sep 17 00:00:00 2001 From: Aaron Picht Date: Fri, 23 Feb 2024 11:18:31 -0800 Subject: [PATCH] MutableMapping is now under collections.abc --- states/helpers.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/states/helpers.py b/states/helpers.py index 08d313a..062a82b 100644 --- a/states/helpers.py +++ b/states/helpers.py @@ -1,6 +1,6 @@ from termcolor import colored from copy import deepcopy -import collections +import collections.abc class FlatDictDiffer(object): @@ -41,7 +41,7 @@ def flatten(d, pkey='', sep='/'): items = [] for k in d: new = pkey + sep + k if pkey else k - if isinstance(d[k], collections.MutableMapping): + if isinstance(d[k], collections.abc.MutableMapping): items.extend(flatten(d[k], new, sep=sep).items()) else: items.append((sep + new, d[k]))