From 58301560d023366492ce9029d9fd17ca29b80da7 Mon Sep 17 00:00:00 2001 From: Jing Ling Date: Mon, 10 Feb 2020 22:04:01 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E5=89=8D=E8=B7=AF=E5=BE=84=E5=88=A4?= =?UTF-8?q?=E6=96=AD=E6=98=AF=E5=90=A6=E4=B8=BANone?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- oneforall/common/utils.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/oneforall/common/utils.py b/oneforall/common/utils.py index 3fd9c8d..4a3d9d5 100644 --- a/oneforall/common/utils.py +++ b/oneforall/common/utils.py @@ -157,6 +157,8 @@ def check_path(path, table, format): :return: 目录路径 """ default_path = config.result_save_path.joinpath(f'{table}.{format}') + if path is None: + path = default_path try: path = Path(path) except Exception as e: @@ -169,6 +171,7 @@ def check_path(path, table, format): if not parent_path.exists(): logger.log('ALERT', f'不存在{parent_path}目录将会新建') parent_path.mkdir(parents=True, exist_ok=True) + # 意外情况 if not path: path = default_path if path.resolve() == default_path: