tests/run-tests.py
branchstable
changeset 977 a50ed14997fc
parent 975 98fa0fa48b7d
child 987 5fc540826f9f
equal deleted inserted replaced
975:98fa0fa48b7d 977:a50ed14997fc
   338 
   338 
   339 def terminate(proc):
   339 def terminate(proc):
   340     """Terminate subprocess (with fallback for Python versions < 2.6)"""
   340     """Terminate subprocess (with fallback for Python versions < 2.6)"""
   341     vlog('# Terminating process %d' % proc.pid)
   341     vlog('# Terminating process %d' % proc.pid)
   342     try:
   342     try:
   343         if hasattr(proc, 'terminate'):
   343         getattr(proc, 'terminate', lambda : os.kill(proc.pid, signal.SIGTERM))()
   344             proc.terminate()
       
   345         else:
       
   346             os.kill(proc.pid, signal.SIGTERM)
       
   347     except OSError:
   344     except OSError:
   348         pass
   345         pass
   349 
   346 
   350 def killdaemons():
   347 def killdaemons():
   351     # Kill off any leftover daemon processes
   348     # Kill off any leftover daemon processes