You use Ipython right? So why not use ipdb, its debugger.
However on Windows you might have an issue if you call ipdb.set_trace() recursively, where the color coding breaks:
The fix may be to comment or alter line 43 in __main__. Or just don't call ipdb.set_trace() in a loop, or from ipython :) .
Or even better use Doug Hellmann's tip and call ipdb from the command line using Python's call module option, `-m`.