]> git.mxchange.org Git - fba.git/commitdiff
changed how dicts are merged
authorEnju Aihara <9839590-EnjuAihara@users.noreply.gitlab.com>
Sat, 23 Apr 2022 12:12:21 +0000 (14:12 +0200)
committerEnju Aihara <9839590-EnjuAihara@users.noreply.gitlab.com>
Sat, 23 Apr 2022 12:12:21 +0000 (14:12 +0200)
fetch_blocks.py

index 7e7199855b2dd11bf8eefde2b9ce3bf2e78d2970..cbdfda2983ee392cfc4e622421e256296e5fd79e 100644 (file)
@@ -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(