From: Gilles DAVID Date: Tue, 20 Sep 2022 12:43:51 +0000 (+0200) Subject: Always close opened file X-Git-Tag: EMC2P_V_1_3_6~1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=66f00e3949e84c45797894cee391dc98e5083395;p=modules%2Fkernel.git Always close opened file --- 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: