The following Python:
p=sh.sleep(100, _bg=True)
try:
p.kill()
except sh.SignalException_SIGKILL:
print('foo')
Gives me:
>>> Exception in thread background thread for pid 14892:
Traceback (most recent call last):
<blah blah blag, long stack trace elided>
sh.SignalException_SIGKILL:
RAN: /usr/bin/sleep 100
STDOUT:
STDERR:
How can I avoid the background thread logging an error for something I expect to happen?