Re: Drop into REPL when your program crashes.

2025-09-10 Thread Ethan Carter
Annada Behera writes: > Hi, > > Recently I have been increasingly adding this piece of code as > a preamble to a lot of my code. > > import (sys, os, ipdb) > > def debug_hook(exc_type, exc_value, traceback): > if exc_type is KeyboardInterrupt: > sys.__excepthook__(exc_

Re: Drop into REPL when your program crashes.

2025-09-10 Thread Annada Behera via Python-list
So, ipdb is the ipython version of pdb. In fact, post_mortem is a pdb function. I use ipdb because its REPL is a bit nicer to work with then pdb. -Original Message- From: Stefan Ram Subject: Re: Drop into REPL when your program crashes. Date: 09/08/2025 06:04:16 PM Newsgroups

Drop into REPL when your program crashes.

2025-09-10 Thread Annada Behera via Python-list
Hi, Recently I have been increasingly adding this piece of code as a preamble to a lot of my code. import (sys, os, ipdb) def debug_hook(exc_type, exc_value, traceback): if exc_type is KeyboardInterrupt: sys.__excepthook__(exc_type, exc_value, traceback) r