From 0a19dd55d3a83fc7d8a7f64670caac9943e639f7 Mon Sep 17 00:00:00 2001 From: Enju Aihara <9839590-EnjuAihara@users.noreply.gitlab.com> Date: Sat, 23 Apr 2022 14:12:21 +0200 Subject: [PATCH] changed how dicts are merged --- fetch_blocks.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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( -- 2.39.5