1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-08-15 10:50:09 +02:00

stop modifying default_config when running fill_config_defaults()

dicts and lists are passed by reference in assignments, so this needs to
copy them instead.
This commit is contained in:
Hans-Christoph Steiner 2021-05-28 10:21:52 +02:00
parent 45bd89b3a2
commit 153b5d4392
No known key found for this signature in database
GPG Key ID: 3E177817BA1B9BFA

View File

@ -224,7 +224,10 @@ def fill_config_defaults(thisconfig):
"""
for k, v in default_config.items():
if k not in thisconfig:
thisconfig[k] = v
if isinstance(v, dict) or isinstance(v, list):
thisconfig[k] = v.copy()
else:
thisconfig[k] = v
# Expand paths (~users and $vars)
def expand_path(path):