equal
deleted
inserted
replaced
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 |