Skip to content

Instantly share code, notes, and snippets.

@bijn
Created May 19, 2024 20:00
Show Gist options
  • Select an option

  • Save bijn/4b5f17572764c773ea406ad9a1d68e8f to your computer and use it in GitHub Desktop.

Select an option

Save bijn/4b5f17572764c773ea406ad9a1d68e8f to your computer and use it in GitHub Desktop.
Starts PDB when SIGINT is sent.
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