If ones catches an exception outside of the function it is originally thrown, ones loses access to the local stack. As a result one cannot inspect the values of the variables th
I know this is old and an answer has already been accepted, but I found this useful (for IPython): start IPython with the --pdb option
ipython --pdb