From d3aa6498608f1a47fe3ad711c9ed3631d4450f05 Mon Sep 17 00:00:00 2001 From: Numquam Scire Date: Sun, 21 Apr 2024 17:39:37 +0300 Subject: [PATCH] Fixing python 3.8+ incompatibilities --- core/plugin.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/core/plugin.py b/core/plugin.py index 92127fc..0965bea 100644 --- a/core/plugin.py +++ b/core/plugin.py @@ -14,12 +14,16 @@ import time import utils.config + def _recursive_update(d, u): # Update value of a nested dictionary of varying depth - + try: + collectionsAbc = collections.abc + except AttributeError: + collectionsAbc = collections for k, v in u.items(): - if isinstance(d, collections.Mapping): - if isinstance(v, collections.Mapping): + if isinstance(d, collectionsAbc.Mapping): + if isinstance(v, collectionsAbc.Mapping): r = _recursive_update(d.get(k, {}), v) d[k] = r else: