From 1c74b4f7eaa10ad8df0b76155097bb8c005ea334 Mon Sep 17 00:00:00 2001 From: vsr Date: Thu, 31 Jul 2008 03:48:33 +0000 Subject: [PATCH] Fix pb with killSalome script: exception is raised at os.listdir() if /tmp/logs/${USER} directory does not exist. --- bin/killSalome.py | 34 +++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/bin/killSalome.py b/bin/killSalome.py index ed9164cf5..1c76890a9 100755 --- a/bin/killSalome.py +++ b/bin/killSalome.py @@ -33,25 +33,33 @@ def killAllPorts(): dirpidict = os.path.dirname(fpidict) fpidict = os.path.basename(fpidict) fnamere = re.compile("^%s$" % fpidict) - for f in os.listdir(dirpidict): - mo = fnamere.match(f) - try: - killMyPort(mo.group(1)) - except: - pass + try: + for f in os.listdir(dirpidict): + mo = fnamere.match(f) + try: + killMyPort(mo.group(1)) + except: + pass + pass + pass + except: pass # provide compatibility with old-style pidict file (not dot-prefixed) fpidict = getPiDict('(\d*)',hidden=False) dirpidict = os.path.dirname(fpidict) fpidict = os.path.basename(fpidict) fnamere = re.compile("^%s$" % fpidict) - for f in os.listdir(dirpidict): - mo = fnamere.match(f) - try: - killMyPort(mo.group(1)) - except: - pass - pass + try: + for f in os.listdir(dirpidict): + mo = fnamere.match(f) + try: + killMyPort(mo.group(1)) + except: + pass + pass + pass + except: + pass # kill other processes if sys.platform != 'win32': import commands -- 2.39.2