From d409e5006b41984f8347bf9187c27862a2f3a81c Mon Sep 17 00:00:00 2001 From: lededev Date: Sun, 19 Sep 2021 03:11:46 +0800 Subject: [PATCH] improve the judgment method of the same directory --- AV_Data_Capture.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AV_Data_Capture.py b/AV_Data_Capture.py index d485cd2..6a70072 100755 --- a/AV_Data_Capture.py +++ b/AV_Data_Capture.py @@ -82,7 +82,7 @@ def rm_empty_folder(path): still_has_subdirs = any( _ for subdir in subdirs if os.path.join(current_dir, subdir) not in deleted ) - if not any(files) and not still_has_subdirs and not abspath == current_dir: + if not any(files) and not still_has_subdirs and not os.path.samefile(path, current_dir): os.rmdir(current_dir) deleted.add(current_dir) print('[+]Deleting empty folder', current_dir)