From: Enju Aihara <9839590-EnjuAihara@users.noreply.gitlab.com> Date: Sat, 23 Apr 2022 12:12:21 +0000 (+0200) Subject: changed how dicts are merged X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=0a19dd55d3a83fc7d8a7f64670caac9943e639f7;p=fba.git changed how dicts are merged --- diff --git a/fetch_blocks.py b/fetch_blocks.py index 7e71998..cbdfda2 100644 --- a/fetch_blocks.py +++ b/fetch_blocks.py @@ -95,8 +95,8 @@ for blocker, software in c.fetchall(): ).json()["metadata"]["federation"] if "mrf_simple" in federation: for block_level, blocks in ( - federation["mrf_simple"] - | {"quarantined_instances": federation["quarantined_instances"]} + {**federation["mrf_simple"], + **{"quarantined_instances": federation["quarantined_instances"]}} ).items(): for blocked in blocks: if blocked == "": @@ -122,10 +122,10 @@ for blocker, software in c.fetchall(): # Reasons if "mrf_simple_info" in federation: for block_level, info in ( - federation["mrf_simple_info"] - | federation["quarantined_instances_info"] + {**federation["mrf_simple_info"], + **(federation["quarantined_instances_info"] if "quarantined_instances_info" in federation - else {} + else {})} ).items(): for blocked, reason in info.items(): c.execute(