[Python-ideas] introspectable assertions (original) (raw)

Skip Montanaro skip.montanaro at gmail.com
Thu Feb 19 15:21:29 CET 2015


On Thu, Feb 19, 2015 at 4:56 AM, Steven D'Aprano <steve at pearwood.info> wrote:

Python already has hooks for customizing tracebacks, see the cgitb module.

Thanks for that reminder. I had forgotten completely about it. In the environment in which I work, we have an exception handler of last resort which logs the traceback to our log file, then exits. This would probably be a good place for me to log the return value of cgitb.text(sys.exc_info()) instead. Sure, it will often dump a fair amount of noise to the log file, but every once in awhile it will probably include a clue which is currently lost.

Skip



More information about the Python-ideas mailing list