<p><code>pdb.pm()</code> puts a breakpoint at the traceback found in <code>sys.last_traceback</code> . This is really useful when you're running some method in a console and you need a breakpoint at the moment the code threw the exception. See more at: #pdb.pm</p>