Salome HOME
[EDF30356] : Extend management of maximum_time attribute format from pylauncher to...
[modules/kernel.git] / bin / salomeContextUtils.py.in
index d9b33b50af2d7822179e0753f72973f3527fe899..71192305de34aaf0b1ec1d1330cf2097ebcf3791 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 2013-2021  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2013-2024  CEA, EDF, OPEN CASCADE
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
@@ -261,9 +261,10 @@ def getScriptsAndArgs(args=None, searchPathList=None):
                 ispython = True
                 break
               pass
-            fn.close()
-          except:
+          except Exception:
             pass
+          finally:
+            fn.close()
           if not ispython and script_extension == ".py":
             currentKey = "@PYTHONBIN@ "+currentScript
           else:
@@ -335,7 +336,7 @@ def setOmniOrbUserPath():
       if not os.access(temp_dir, os.W_OK):
         raise Exception("Unable to get write access to directory: %s"%temp_dir)
       os.environ["OMNIORB_USER_PATH"] = temp_dir
-    except:
+    except Exception:
       homePath = os.path.realpath(os.path.expanduser('~'))
       #defaultOmniorbUserPath = os.path.join(homePath, ".salomeConfig/USERS")
       defaultOmniorbUserPath = homePath