From d769bfcc38a14720fa888e2b7c0ff874cc91f6a2 Mon Sep 17 00:00:00 2001 From: BonfaceKilz Date: Thu, 3 Jun 2021 21:39:25 +0300 Subject: gn3: db: Replace items() with keys() * gn3/db/__init__.py (diff_from_dict): We only use the keys of the dict! --- gn3/db/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'gn3') diff --git a/gn3/db/__init__.py b/gn3/db/__init__.py index ce92a7d..d62b575 100644 --- a/gn3/db/__init__.py +++ b/gn3/db/__init__.py @@ -93,6 +93,7 @@ def insert(conn: Any, conn.commit() return cursor.rowcount + def diff_from_dict(old: Dict, new: Dict) -> Dict: """Construct a new dict with a specific structure that contains the difference between the 2 dicts in the structure: @@ -104,6 +105,6 @@ Should return: {"id": {"old": 1, "new": 2}, "data": {"old": "a", "new": "b"}} """ dict_ = {} - for key, value in old.items(): + for key in old.keys(): dict_[key] = {"old": old[key], "new": new[key]} return dict_ -- cgit v1.2.3