Skip to content

Commit

Permalink
Check file exists before fixing Cantera file
Browse files Browse the repository at this point in the history
  • Loading branch information
alongd committed Dec 4, 2024
1 parent d55277c commit c11d3ef
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions t3/utils/fix_cantera.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ def fix_cantera(model_path: str):
Returns:
bool: Whether the model was fixed.
"""
if not os.path.isfile(model_path):
return False
shutil.copyfile(model_path, model_path + '.bak')
done, fixed = False, False
counter = 0
Expand Down

0 comments on commit c11d3ef

Please sign in to comment.