From 89e78b9a001535b6fe21480912744962a8ac9d2e Mon Sep 17 00:00:00 2001 From: Eric Callahan Date: Wed, 16 Feb 2022 09:13:45 -0500 Subject: [PATCH] database: fix type reported in overwrite warning Signed-off-by: Eric Callahan --- moonraker/components/database.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/moonraker/components/database.py b/moonraker/components/database.py index a017565..3981284 100644 --- a/moonraker/components/database.py +++ b/moonraker/components/database.py @@ -203,10 +203,11 @@ class MoonrakerDatabase: if len(key_list) > 1: record = self._get_record(namespace, key_list[0], force=True) if not isinstance(record, dict): + prev_type = type(record) record = {} logging.info( - f"Warning: Key {key_list[0]} contains a value of type" - f" {type(record)}. Overwriting with an object.") + f"Warning: Key {key_list[0]} contains a value of type " + f"{prev_type}. Overwriting with an object.") item: Dict[str, Any] = reduce( getitem_with_default, key_list[1:-1], record) item[key_list[-1]] = value