当前位置: 首页>>代码示例>>Python>>正文


Python Pdb.reset方法代码示例

本文整理汇总了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)
开发者ID:omergertel,项目名称:ipdb,代码行数:10,代码来源:__main__.py

示例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)
开发者ID:pkimber,项目名称:my-memory,代码行数:10,代码来源:ipdb.py

示例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)
开发者ID:dmsul,项目名称:ipdb,代码行数:12,代码来源:__main__.py

示例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)
开发者ID:moon2l,项目名称:ipdb,代码行数:13,代码来源:__main__.py

示例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)
开发者ID:DamianHeard,项目名称:ipdb,代码行数:13,代码来源:__main__.py

示例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)
开发者ID:Doik,项目名称:micropsi2,代码行数:18,代码来源:tools.py

示例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)
开发者ID:joeywen,项目名称:zarkov,代码行数:19,代码来源:config.py

示例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:
开发者ID:jagguli,项目名称:PyBug,代码行数:33,代码来源:bug.py


注:本文中的IPython.core.debugger.Pdb.reset方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。