diff options
author | Lars Wirzenius <liw@liw.fi> | 2020-07-19 11:45:53 +0300 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2020-07-19 13:28:44 +0300 |
commit | e50eea1299a337a4c2164e069ab0bfa65609424f (patch) | |
tree | 0bcf579cd891270b73b63160b305cd8979967a42 | |
parent | 8fc8c54d9f5973df0a1085ae357bc8bb97fba534 (diff) | |
download | ewww-e50eea1299a337a4c2164e069ab0bfa65609424f.tar.gz |
test: log call of terminate_process, and its failure
This avoids an ugly and unnecessary stack trace when ewww failed to
start, and thus there is no process with the assumed pid. Also, this
makes debugging test failures a little easier.
-rw-r--r-- | daemon.py | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -65,5 +65,10 @@ def process_exists(pid): # Terminate process. -def terminate_process(pid, signal): - os.kill(pid, signal) +def terminate_process(pid, signalno): + logging.debug(f"Terminating process {pid} with signal {signalno}") + try: + os.kill(pid, signalno) + except ProcessLookupError: + logging.debug("Process did not actually exist (anymore?)") + pass |