From 089f748a184b267f2a983d631db879e3a8ba150d Mon Sep 17 00:00:00 2001 From: Stephen Finucane Date: Mon, 1 Feb 2021 09:42:13 +0000 Subject: [PATCH] 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 --- barbican/api/controllers/__init__.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/barbican/api/controllers/__init__.py b/barbican/api/controllers/__init__.py index d2256122f..4e699c298 100644 --- a/barbican/api/controllers/__init__.py +++ b/barbican/api/controllers/__init__.py @@ -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))