Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
cli
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
funkwhale
cli
Commits
db1f14f3
Commit
db1f14f3
authored
2 years ago
by
JuniorJPDJ
Browse files
Options
Downloads
Plain Diff
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
!22
fix: python 3.10 compatibility
Pipeline
#22195
passed
2 years ago
Stage: test
Stage: build
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
funkwhale_cli/utils.py
+6
-2
6 additions, 2 deletions
funkwhale_cli/utils.py
with
6 additions
and
2 deletions
funkwhale_cli/utils.py
+
6
−
2
View file @
db1f14f3
import
collections
import
json
import
json
import
urllib.parse
import
urllib.parse
import
pathvalidate
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
):
def
recursive_getattr
(
obj
,
key
,
permissive
=
False
):
"""
"""
...
@@ -92,7 +96,7 @@ def flatten(d, parent_key="", sep="_"):
...
@@ -92,7 +96,7 @@ def flatten(d, parent_key="", sep="_"):
items
=
[]
items
=
[]
for
k
,
v
in
d
.
items
():
for
k
,
v
in
d
.
items
():
new_key
=
parent_key
+
sep
+
k
if
parent_key
else
k
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
())
items
.
extend
(
flatten
(
v
,
new_key
,
sep
=
sep
).
items
())
else
:
else
:
items
.
append
((
new_key
,
v
))
items
.
append
((
new_key
,
v
))
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment