From f44979f983e5820a37909cc67dbb3c63fc123d95 Mon Sep 17 00:00:00 2001 From: 6vision Date: Mon, 24 Jun 2024 21:57:58 +0800 Subject: [PATCH] Fix TypeError in config drag_sensitive function --- config.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config.py b/config.py index 7f485aa..50d2fbd 100644 --- a/config.py +++ b/config.py @@ -242,7 +242,7 @@ def drag_sensitive(config): conf_dict_copy = copy.deepcopy(conf_dict) for key in conf_dict_copy: if "key" in key or "secret" in key: - if isinstance(key, str): + if isinstance(conf_dict_copy[key], str): conf_dict_copy[key] = conf_dict_copy[key][0:3] + "*" * 5 + conf_dict_copy[key][-3:] return json.dumps(conf_dict_copy, indent=4) @@ -250,7 +250,7 @@ def drag_sensitive(config): config_copy = copy.deepcopy(config) for key in config: if "key" in key or "secret" in key: - if isinstance(key, str): + if isinstance(config_copy[key], str): config_copy[key] = config_copy[key][0:3] + "*" * 5 + config_copy[key][-3:] return config_copy except Exception as e: