From a4f06dac78f3ac0b828174f911aa8ff6e0ee48a4 Mon Sep 17 00:00:00 2001 From: Mark Payne Date: Tue, 26 Jan 2021 13:55:01 -0500 Subject: [PATCH] Remove temporary seed mechanisms if they exist --- rmgpy/rmg/main.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/rmgpy/rmg/main.py b/rmgpy/rmg/main.py index 01763b7605..9d1b266ddf 100644 --- a/rmgpy/rmg/main.py +++ b/rmgpy/rmg/main.py @@ -1342,6 +1342,10 @@ def make_seed_mech(self): temp_seed_dir = os.path.join(self.output_directory, 'seed_tmp') # Move the seed from the previous iteration to a temporary directory in case we run into errors + + # First, remove the temporary seed mechanism if it exists from a previous run + if os.path.exists(temp_seed_dir): + shutil.rmtree(temp_seed_dir) try: os.rename(seed_dir, temp_seed_dir) except PermissionError: # The Windows Subsystem for Linux (WSL) can have problems with renaming