It took several months to do nothing, but I accidentally stumbled upon a solution. I am sure this is nothing new for the more experienced.
I have the following in my environment:
export PYTHONUSERBASE=~/.python export PYTHONPATH=$PYTHONPATH:$PYTHONUSERBASE
And I have the following file:
~/.python/lib/python2.7/site-packages/usercustomize.py
With the following contents:
import traceback import sys try: import pudb as debugger except ImportError: import pdb as debugger def drop_debugger(type, value, tb): traceback.print_exception(type, value, tb) debugger.pm() sys.excepthook = drop_debugger __builtins__['debugger'] = debugger __builtins__['st'] = debugger.set_trace
Now, whether interactively or not, the debugger always jumps to the exception. It might be nice to come up with this.
It is important that you do not have no-global-site-packages.txt in site-packages . This will disable the default site.py module usercustomize (my virtualenv had no-global-site-packages.txt )
Just in case, this would help others, I stayed in a bit about changing __builtins__ . Itβs very convenient for me to always be able to rely on some of the tools available.
The aroma of taste.
source share