Created
May 19, 2024 20:00
-
-
Save bijn/4b5f17572764c773ea406ad9a1d68e8f to your computer and use it in GitHub Desktop.
Starts PDB when SIGINT is sent.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import signal | |
| # could be cool to have a configurable prompt | |
| def _pdb_sigint(signum, frame): | |
| breakpoint() | |
| signal.signal(signal.SIGINT, _pdb_sigint) | |
| # use with `import pdb_sigint` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment