From c11d3ef74f36c022328a4cdc109fd7d8767fec11 Mon Sep 17 00:00:00 2001 From: Alon Grinberg Dana Date: Wed, 4 Dec 2024 14:27:30 +0200 Subject: [PATCH] Check file exists before fixing Cantera file --- t3/utils/fix_cantera.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/t3/utils/fix_cantera.py b/t3/utils/fix_cantera.py index 99e61e9b..a97748cd 100644 --- a/t3/utils/fix_cantera.py +++ b/t3/utils/fix_cantera.py @@ -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