Salome HOME
Always close opened file
authorGilles DAVID <gilles-g.david@edf.fr>
Tue, 20 Sep 2022 12:43:51 +0000 (14:43 +0200)
committerGilles DAVID <gilles-g.david@edf.fr>
Tue, 20 Sep 2022 12:45:12 +0000 (14:45 +0200)
bin/salomeContextUtils.py.in

index b5fcd63adcbd1fe0d186b013269f2b21f1448814..f7f0d8310932df832fc8765922c1e7ba607ae8ae 100644 (file)
@@ -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: