From 6ed1eb2d174832fa725acd126ba1b46295ae40de Mon Sep 17 00:00:00 2001 From: Fallen_Breath Date: Tue, 4 Apr 2023 23:26:04 +0800 Subject: [PATCH] fix using undocumented api --- .gitignore | 4 +++- chatbridge/impl/utils.py | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index a4e5bf9..6ffbf03 100644 --- a/.gitignore +++ b/.gitignore @@ -4,11 +4,13 @@ test.py *.log *.pyc -/__pycache__ +__pycache__ StatsHelper.py /stats_helper /more_apis *.zip *.mcdr *.pyz +*.bat +*.sh ChatBridge_*.json diff --git a/chatbridge/impl/utils.py b/chatbridge/impl/utils.py index a77c58c..29cf935 100644 --- a/chatbridge/impl/utils.py +++ b/chatbridge/impl/utils.py @@ -20,7 +20,7 @@ def load_config(config_path: str, config_class: Type[T]) -> T: raise FileNotFoundError(config_path) else: with open(config_path, encoding='utf8') as file: - config.update_from(json.load(file)) + vars(config).update(vars(config_class.deserialize(json.load(file)))) with open(config_path, 'w', encoding='utf8') as file: json.dump(config.serialize(), file, ensure_ascii=False, indent=4) return config