pipebox: improve signal handling

Improve the handling of signals by leveraging the `Py_AtExit`
functionality to trigger cleanup when the interpreter exits.
When receiving SIGINT handle it specially because exceptions in python
are only thrown when the interpreter is running and not when C code is.
This commit is contained in:
Giacomo Vercesi
2026-01-08 14:02:54 +01:00
parent 4093628b39
commit fd14580619
3 changed files with 48 additions and 22 deletions
-2
View File
@@ -26,8 +26,6 @@ def initialize(argv: list[str] = []):
signal.SIGTERM,
signal.SIGHUP,
signal.SIGQUIT,
},
{
signal.SIGCHLD,
signal.SIGPIPE,
signal.SIGUSR1,