本文整理汇总了Python中IPython.core.debugger.Pdb.reset方法的典型用法代码示例。如果您正苦于以下问题:Python Pdb.reset方法的具体用法?Python Pdb.reset怎么用?Python Pdb.reset使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IPython.core.debugger.Pdb
的用法示例。
在下文中一共展示了Pdb.reset方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: post_mortem
# 需要导入模块: from IPython.core.debugger import Pdb [as 别名]
# 或者: from IPython.core.debugger.Pdb import reset [as 别名]
def post_mortem(tb):
update_stdout()
wrap_sys_excepthook()
p = Pdb(def_colors)
p.reset()
if tb is None:
return
p.interaction(None, tb)
示例2: post_mortem
# 需要导入模块: from IPython.core.debugger import Pdb [as 别名]
# 或者: from IPython.core.debugger.Pdb import reset [as 别名]
def post_mortem(tb):
ip = ipapi.get()
def_colors = ip.colors
p = Pdb(def_colors)
p.reset()
while tb.tb_next is not None:
tb = tb.tb_next
p.interaction(tb.tb_frame, tb)
示例3: post_mortem
# 需要导入模块: from IPython.core.debugger import Pdb [as 别名]
# 或者: from IPython.core.debugger.Pdb import reset [as 别名]
def post_mortem(tb):
update_stdout()
wrap_sys_excepthook()
p = Pdb(def_colors)
p.reset()
if tb is None:
return
while tb.tb_next is not None:
tb = tb.tb_next
p.interaction(tb.tb_frame, tb)
示例4: post_mortem
# 需要导入模块: from IPython.core.debugger import Pdb [as 别名]
# 或者: from IPython.core.debugger.Pdb import reset [as 别名]
def post_mortem(tb):
update_stdout()
BdbQuit_excepthook.excepthook_ori = sys.excepthook
sys.excepthook = BdbQuit_excepthook
p = Pdb(def_colors)
p.reset()
if tb is None:
return
while tb.tb_next is not None:
tb = tb.tb_next
p.interaction(tb.tb_frame, tb)
示例5: post_mortem
# 需要导入模块: from IPython.core.debugger import Pdb [as 别名]
# 或者: from IPython.core.debugger.Pdb import reset [as 别名]
def post_mortem(tb):
update_stdout()
sys.excepthook = lambda et, ev, tb, orig_hook=sys.excepthook: \
BdbQuit_excepthook(et, ev, tb, orig_hook)
p = Pdb(def_colors)
p.reset()
if tb is None:
return
while tb.tb_next is not None:
tb = tb.tb_next
p.interaction(tb.tb_frame, tb)
示例6: interactive_pdb
# 需要导入模块: from IPython.core.debugger import Pdb [as 别名]
# 或者: from IPython.core.debugger.Pdb import reset [as 别名]
def interactive_pdb():
""" inspect the traceback of the most recent exception. """
import traceback
from IPython.core.debugger import Pdb
if last_tb is None:
print("Nothing to debug.")
return
# print to stdout (sic!) what this pdb session is about
msg = traceback.format_tb(last_tb)[-5:]
print('Starting PDB session for:\n\n\033[94m%s\033[0m\n' % ''.join(msg))
pdb = Pdb()
pdb.reset()
pdb.interaction(frame=None, traceback=last_tb)
示例7: postmortem_hook
# 需要导入模块: from IPython.core.debugger import Pdb [as 别名]
# 或者: from IPython.core.debugger.Pdb import reset [as 别名]
def postmortem_hook(etype, value, tb): # pragma no cover
import pdb, traceback
try:
from IPython.core.debugger import Pdb
sys.stderr.write('Entering post-mortem IPDB shell\n')
p = Pdb(color_scheme='Linux')
p.reset()
p.setup(None, tb)
p.print_stack_trace()
sys.stderr.write('%s: %s\n' % ( etype, value))
p.cmdloop()
p.forget()
# p.interaction(None, tb)
except ImportError:
sys.stderr.write('Entering post-mortem PDB shell\n')
traceback.print_exception(etype, value, tb)
pdb.post_mortem(tb)
示例8: __import__
# 需要导入模块: from IPython.core.debugger import Pdb [as 别名]
# 或者: from IPython.core.debugger.Pdb import reset [as 别名]
file = frame.f_code.co_filename
elif not file.startswith("file:") and os.path.sep not in file:
try:
mod = __import__(file, globals(), locals(), ["__file__"])
except ImportError, err:
if throw:
raise
sys.__stdout__.write("cannot set breakpoint: %s:%s : %s" %
(file, line, err))
return
file = mod.__file__
sys.__stdout__.write("breaking in: %s" % file)
if file.endswith(".pyc"):
file = file[:-1]
pdb = Pdb(color_scheme='Linux', stdout=sys.__stdout__) # use sys.__stdout__ to work with nose tests
pdb.reset()
pdb.curframe = frame
while frame:
frame.f_trace = pdb.trace_dispatch
pdb.botframe = frame
frame = frame.f_back
templine = line
while templine < line + 10:
error = pdb.set_break(file, templine, cond=cond, temporary=temp)
if error:
templine += 1
else:
break
if error:
error = pdb.set_break(file, line, cond=cond, temporary=temp)
if throw: