-# Copyright (C) 2021 CEA/DEN, EDF R&D
+# Copyright (C) 2021-2023 CEA, EDF
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# Close SALOME GUI
import salome_utils
-import subprocess
-port = salome_utils.getPortNumber()
-proc = subprocess.Popen(["killSalomeWithPort.py", "{}".format(port)])
+import killSalomeWithPort
+
+port = salome_utils.getPortNumber(False)
+if port:
+ killSalomeWithPort.killMyPort(port)