Normalize spaces and tabs: modules/catalyst/spawn.py - def cleanup
authorRobin H. Johnson <robbat2@orbis-terrarum.net>
Wed, 27 May 2009 15:47:32 +0000 (08:47 -0700)
committerRobin H. Johnson <robbat2@orbis-terrarum.net>
Wed, 27 May 2009 15:47:32 +0000 (08:47 -0700)
modules/catalyst/spawn.py

index 345270e9baa169eaf8dac565db82e89760651f6e..9ab2a230e464be2777713fa72c843d8f57428278 100644 (file)
@@ -27,30 +27,31 @@ except:
 spawned_pids = []
 
 def cleanup(pids,block_exceptions=True):
-        """function to go through and reap the list of pids passed to it"""
-        global spawned_pids
-        if type(pids) == int:
-                pids = [pids]
-        for x in pids:
-                try:
-                        os.kill(x,signal.SIGTERM)
-                        if os.waitpid(x,os.WNOHANG)[1] == 0:
-                                # feisty bugger, still alive.
-                                os.kill(x,signal.SIGKILL)
-                                os.waitpid(x,0)
-
-                except OSError, oe:
-                        if block_exceptions:
-                                pass
-                        if oe.errno not in (10,3):
-                                raise oe
-                except SystemExit:
-                        raise
-                except Exception:
-                        if block_exceptions:
-                                pass
-                try:                    spawned_pids.remove(x)
-                except IndexError:      pass
+       """function to go through and reap the list of pids passed to it"""
+       global spawned_pids
+       if type(pids) == int:
+               pids = [pids]
+       for x in pids:
+               try:
+                       os.kill(x,signal.SIGTERM)
+                       if os.waitpid(x,os.WNOHANG)[1] == 0:
+                               # feisty bugger, still alive.
+                               os.kill(x,signal.SIGKILL)
+                               os.waitpid(x,0)
+               except OSError, oe:
+                       if block_exceptions:
+                               pass
+                       if oe.errno not in (10,3):
+                               raise oe
+               except SystemExit:
+                       raise
+               except Exception:
+                       if block_exceptions:
+                               pass
+               try:                    
+                       spawned_pids.remove(x)
+               except IndexError:
+                       pass
 
 
 def spawn_bash(mycommand,env={},debug=False,opt_name=None,**keywords):