]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
Fix pb with killSalome script: exception is raised at os.listdir() if /tmp/logs/...
authorvsr <vsr@opencascade.com>
Thu, 31 Jul 2008 03:47:17 +0000 (03:47 +0000)
committervsr <vsr@opencascade.com>
Thu, 31 Jul 2008 03:47:17 +0000 (03:47 +0000)
bin/killSalome.py

index ed9164cf5388bf3202d2fe5e40ff27fda4915927..1c76890a96cc6cd71eaf08bbf2e9b89a9da0df7f 100755 (executable)
@@ -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