parameters: (pid)
docstring: This function kills a process with ``pid`` and all its
      running children (recursively). It is currently implemented
      using the psutil module which provides a simple platform
      neutral implementation.
  
      TODO: Reimplement this without using psutil so we can
            remove our dependency on it.
docstring_summary: This function kills a process with ``pid`` and all its
      running children (recursively). It is currently implemented
      using the psutil module which provides a simple platform
      neutral implementation.
docstring_tokens: This function kills a process with pid and all its running children ( recursively ) . It is currently implemented using the psutil module which provides a simple platform neutral implementation .
function: def killProcessAndChildren(pid):
      """
      This function kills a process with ``pid`` and all its
      running children (recursively). It is currently implemented
      using the psutil module which provides a simple platform
      neutral implementation.
  
      TODO: Reimplement this without using psutil so we can
            remove our dependency on it.
      """
      if platform.system() == 'AIX':
          subprocess.call('kill -kill $(ps -o pid= -L{})'.format(pid), shell=True)
      else:
          import psutil
          try:
              psutilProc = psutil.Process(pid)
              # Handle the different psutil API versions
              try:
                  # psutil >= 2.x
                  children_iterator = psutilProc.children(recursive=True)
              except AttributeError:
                  # psutil 1.x
                  children_iterator = psutilProc.get_children(recursive=True)
              for child in children_iterator:
                  try:
                      child.kill()
                  except psutil.NoSuchProcess:
                      pass
              psutilProc.kill()
          except psutil.NoSuchProcess:
              pass
function_tokens: def killProcessAndChildren ( pid ) : if platform . system ( ) == 'AIX' : subprocess . call ( 'kill -kill $(ps -o pid= -L{})' . format ( pid ) , shell = True ) else : import psutil try : psutilProc = psutil . Process ( pid ) # Handle the different psutil API versions try : # psutil >= 2.x children_iterator = psutilProc . children ( recursive = True ) except AttributeError : # psutil 1.x children_iterator = psutilProc . get_children ( recursive = True ) for child in children_iterator : try : child . kill ( ) except psutil . NoSuchProcess : pass psutilProc . kill ( ) except psutil . NoSuchProcess : pass