3 ms·
In the exception handler, you should reset SIGPIPE disposition and reraise the signal: signal.signal(signal.SIGPIPE, signal.SIG_DFL) os.kill(os.getpid(),
by jwilk 7y ago
In the exception handler, you should reset SIGPIPE disposition and reraise the signal:
signal.signal(signal.SIGPIPE, signal.SIG_DFL)
os.kill(os.getpid(), signal.SIGPIPE)
(Then there's no need to fiddle with stderr.)