Skip to content
Snippets Groups Projects
Commit db1f14f3 authored by JuniorJPDJ's avatar JuniorJPDJ
Browse files

Merge branch 'JuniorJPDJ-master-patch-97444' into 'master'

fix: python 3.10 compatibility

Closes #28

See merge request !22
parents 21df5646 5093eb90
No related branches found
No related tags found
1 merge request!22fix: python 3.10 compatibility
Pipeline #22195 passed with stages
in 7 minutes and 51 seconds
import collections
import json
import urllib.parse
import pathvalidate
try:
from collections.abc import MutableMapping
except ImportError:
# python<3.10 compatibility
from collections import MutableMapping
def recursive_getattr(obj, key, permissive=False):
"""
......@@ -92,7 +96,7 @@ def flatten(d, parent_key="", sep="_"):
items = []
for k, v in d.items():
new_key = parent_key + sep + k if parent_key else k
if isinstance(v, collections.MutableMapping):
if isinstance(v, MutableMapping):
items.extend(flatten(v, new_key, sep=sep).items())
else:
items.append((new_key, v))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment