From: vsr Date: Thu, 31 Jul 2008 03:48:33 +0000 (+0000) Subject: Fix pb with killSalome script: exception is raised at os.listdir() if /tmp/logs/... X-Git-Tag: TG_TRIPOLI_qt4_porting~31 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=1c74b4f7eaa10ad8df0b76155097bb8c005ea334;p=modules%2Fkernel.git Fix pb with killSalome script: exception is raised at os.listdir() if /tmp/logs/${USER} directory does not exist. --- 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