Albert-Jan Roskam wrote at 2022-7-31 11:39 +0200: > I have a function init_logging.log_uncaught_errors() that I use for > sys.excepthook. Now I also want to call another function (ffi.dlclose()) > upon abnormal termination. Is it possible to register multiple > excepthooks, like with atexit.register? Or should I rename/redefine > log_uncaught_errors() so it does both things?
`sys.excepthook` is a single function (not a list of them). This means: at any moment a single `excepthook` is effective. If you need a modular design, use a dispatcher function as your `excepthook` associated with a registry (e.g. a `list`). The dispatcher can then call all registered function. -- https://mail.python.org/mailman/listinfo/python-list