Added ipdb() function to help debug SCons scripts

This commit is contained in:
Ray Speth 2012-01-18 23:44:54 +00:00
parent 6589eb7f7c
commit cf80213e6b

View file

@ -401,3 +401,15 @@ def removeDirectory(name):
if os.path.exists(name):
print 'Removing directory "%s"' % name
shutil.rmtree(name)
def ipdb():
"""
Break execution and drop into an IPython debug shell at the point
where this function is called.
"""
from IPython.core.debugger import Pdb
from IPython.core import ipapi
ip = ipapi.get()
def_colors = ip.colors
Pdb(def_colors).set_trace(sys._getframe().f_back)