Merge "Fix usage of"

Zuul 2021-11-04 17:34:56 +00:00 committed by Gerrit Code Review
commit d690e9fec4
1 changed files with 3 additions and 7 deletions

View File

@ -14,11 +14,7 @@
import collections
collectionsAbc =
except AttributeError:
collectionsAbc = collections
from collections import abc as collections_abc
import configparser
import csv
@ -735,9 +731,9 @@ def convert(data):
"""Recursively converts dictionary keys,values to strings."""
if isinstance(data, str):
return str(data)
if isinstance(data, collectionsAbc.Mapping):
if isinstance(data, collections_abc.Mapping):
return dict(map(convert, data.items()))
if isinstance(data, collectionsAbc.Iterable):
if isinstance(data, collections_abc.Iterable):
return type(data)(map(convert, data))
return data