From 965130815d96d79fd7ba34c1177f8190a0745c2c Mon Sep 17 00:00:00 2001 From: Nick Sweeting Date: Mon, 30 Oct 2017 02:55:39 -0500 Subject: [PATCH] check if folder exists before trying to cleanup --- util.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/util.py b/util.py index 74aec6d8..d6b6029f 100644 --- a/util.py +++ b/util.py @@ -344,11 +344,12 @@ def merge_folders(path, folder, link): for file in files_in_source: run(['mv', os.path.join(source, file), os.path.join(target, file)]) - files_in_source = set(os.listdir(source)) - if files_in_source: - manually_merge_folders(source, target) - else: - run(['rm', '-R', source]) + if os.path.exists(source): + files_in_source = set(os.listdir(source)) + if files_in_source: + manually_merge_folders(source, target) + else: + run(['rm', '-R', source]) def cleanup_archive(path, links):