From 9fd9d571ad8cafa78e4c24a07c3a46dfe28767d4 Mon Sep 17 00:00:00 2001 From: z4yx Date: Sun, 19 Apr 2020 20:03:02 +0800 Subject: [PATCH] replace rmtree with rmdir --- apt-sync.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apt-sync.py b/apt-sync.py index 476b288..0eb10f9 100755 --- a/apt-sync.py +++ b/apt-sync.py @@ -218,9 +218,9 @@ def apt_mirror(base_url: str, dist: str, repo: str, arch: str, dest_base_dir: Pa move_files_in(comp_tmp_dir, comp_dir) move_files_in(dist_tmp_dir, dist_dir) - shutil.rmtree(str(pkgidx_tmp_dir)) - shutil.rmtree(str(comp_tmp_dir)) - shutil.rmtree(str(dist_tmp_dir)) + pkgidx_tmp_dir.rmdir() + comp_tmp_dir.rmdir() + dist_tmp_dir.rmdir() except: traceback.print_exc() return 1