Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX: Only remove temporary folder if it is present #4379

Merged
merged 4 commits into from
Oct 27, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion aiida/engine/processes/calcjobs/calcjob.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,8 @@ def parse(self, retrieved_temporary_folder=None):
try:
exit_code_retrieved = self.parse_retrieved_output(retrieved_temporary_folder)
finally:
shutil.rmtree(retrieved_temporary_folder, ignore_errors=True)
if retrieved_temporary_folder is not None:
shutil.rmtree(retrieved_temporary_folder, ignore_errors=True)

if exit_code_retrieved is not None and exit_code_retrieved.status > 0:
msg = f'output parser returned exit code<{exit_code_retrieved.status}>: {exit_code_retrieved.message}'
Expand Down