From 66f00e3949e84c45797894cee391dc98e5083395 Mon Sep 17 00:00:00 2001 From: Gilles DAVID Date: Tue, 20 Sep 2022 14:43:51 +0200 Subject: [PATCH] Always close opened file --- bin/salomeContextUtils.py.in | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bin/salomeContextUtils.py.in b/bin/salomeContextUtils.py.in index b5fcd63ad..f7f0d8310 100644 --- a/bin/salomeContextUtils.py.in +++ b/bin/salomeContextUtils.py.in @@ -261,9 +261,10 @@ def getScriptsAndArgs(args=None, searchPathList=None): ispython = True break pass - fn.close() except Exception: pass + finally: + fn.close() if not ispython and script_extension == ".py": currentKey = "@PYTHONBIN@ "+currentScript else: -- 2.39.2