From 6c23b42f71e537ee72828dcd84ffb1beb7ffc3dd Mon Sep 17 00:00:00 2001 From: RGBCube <78925721+RGBCube@users.noreply.github.com> Date: Sat, 15 Jan 2022 16:24:29 +0300 Subject: [PATCH] huge mistake reverted & no exec --- db.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/db.py b/db.py index f046f4f..e5e8cf9 100644 --- a/db.py +++ b/db.py @@ -20,13 +20,12 @@ class Utils: else: alt_dict[key] = {} return alt_dict - exec_str = "main_dict" + main_dict_ref = main_dict for dict_name in path.split("+"): - exec_str = f"magic({exec_str}, '{dict_name}')['{dict_name}']" - if path.index(dict_name) == len(path) - 1: - exec_str = f"{exec_str}['{key}'] = {value}" - exec(exec_str) - return main_dict + main_dict = magic(main_dict, dict_name)[dict_name] + if path.split("+").index(dict_name) == len(path.split("+")) - 1: + main_dict[key] = value + return main_dict_ref class ClutterDB: