tests/killdaemons.py
changeset 25031 0adc22a0b6b3
parent 21194 476069509e72
child 25473 123c99034cb6
equal deleted inserted replaced
25030:33298a8b472f 25031:0adc22a0b6b3
    62             else:
    62             else:
    63                 time.sleep(0.1)
    63                 time.sleep(0.1)
    64                 os.kill(pid, 0)
    64                 os.kill(pid, 0)
    65             logfn('# Daemon process %d is stuck - really killing it' % pid)
    65             logfn('# Daemon process %d is stuck - really killing it' % pid)
    66             os.kill(pid, signal.SIGKILL)
    66             os.kill(pid, signal.SIGKILL)
    67         except OSError, err:
    67         except OSError as err:
    68             if err.errno != errno.ESRCH:
    68             if err.errno != errno.ESRCH:
    69                 raise
    69                 raise
    70 
    70 
    71 def killdaemons(pidfile, tryhard=True, remove=False, logfn=None):
    71 def killdaemons(pidfile, tryhard=True, remove=False, logfn=None):
    72     if not logfn:
    72     if not logfn: