Add faulthandler for traceback on signals

This commit is contained in:
Christopher T. Johnson
2024-04-02 10:59:52 -04:00
parent ea999e03f0
commit 483e5cf64a

View File

@@ -6,8 +6,10 @@
# Reading scroll with speed control # Reading scroll with speed control
# Ability to edit text with updates to word-section links # Ability to edit text with updates to word-section links
# #
import faulthandler
import os import os
import re import re
import signal
import sys import sys
from typing import Optional, cast from typing import Optional, cast
@@ -320,4 +322,7 @@ if __name__ == "__main__":
# XXX - Update the Makefile so that we can run a `make -q` will # XXX - Update the Makefile so that we can run a `make -q` will
# report back if make needs to be run. # report back if make needs to be run.
# #
faulthandler.enable()
faulthandler.register(signal.SIGHUP)
faulthandler.register(signal.SIGUSR1)
sys.exit(main()) sys.exit(main())