From d29ad47f7bd01e8f4d3a7e95cce39e745ebcd819 Mon Sep 17 00:00:00 2001 From: benjamin <24502572+ddtyjmyjm@users.noreply.github.com> Date: Mon, 21 Dec 2020 21:41:32 +0800 Subject: [PATCH] fix: fix the bug that if fail or success folder only has empty folders, it will also remove the fail or success folder. --- AV_Data_Capture.py | 2 +- core.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/AV_Data_Capture.py b/AV_Data_Capture.py index 1209a22..145d233 100755 --- a/AV_Data_Capture.py +++ b/AV_Data_Capture.py @@ -59,7 +59,7 @@ def rm_empty_folder(path): try: files = os.listdir(path) # 获取路径下的子文件(夹)列表 for file in files: - os.removedirs(path + '/' + file) # 删除这个空文件夹 + os.rmdir(path + '/' + file) # 删除这个空文件夹 print('[+]Deleting empty folder', path + '/' + file) except: a = '' diff --git a/core.py b/core.py index 9e47fce..27a51f0 100755 --- a/core.py +++ b/core.py @@ -31,7 +31,7 @@ def escape_path(path, escape_literals: str): # Remove escape literals def moveFailedFolder(filepath, failed_folder): print('[-]Move to Failed output folder') shutil.move(filepath, str(os.getcwd()) + '/' + failed_folder + '/') - return + return def get_data_from_json(file_number, filepath, conf: config.Config): # 从JSON返回元数据