From 3ba9456fc65539aee41737bb45186a38b08dc82d Mon Sep 17 00:00:00 2001 From: ihmily <961532186@qq.com> Date: Mon, 23 Sep 2024 20:48:30 +0800 Subject: [PATCH] fix: add file not found excception catch --- quark.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/quark.py b/quark.py index 7dbaa9e..abd8ef3 100644 --- a/quark.py +++ b/quark.py @@ -395,7 +395,7 @@ def init_config(self, _user, _pdir_id, _dir_name): else: _pdir_id = json_data.get('pdir_id', '0') _dir_name = json_data.get('dir_name', '根目录') - except json.decoder.JSONDecodeError: + except (json.decoder.JSONDecodeError, FileNotFoundError): new_config = {'user': self.user, 'pdir_id': self.pdir_id, 'dir_name': self.dir_name} save_config(f'{CONFIG_DIR}/config.json', content=json.dumps(new_config, ensure_ascii=False)) return _user, _pdir_id, _dir_name