Skip to content

Commit

Permalink
Remove temporary seed mechanisms if they exist
Browse files Browse the repository at this point in the history
  • Loading branch information
amarkpayne authored and mjohnson541 committed Jan 26, 2021
1 parent 1e21621 commit a4f06da
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions rmgpy/rmg/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a4f06da

Please sign in to comment.