ipdb如何将python调试器带到称为第三方代码的框架

mot*_*m79 6 python debugging ipdb

在我的python代码中,我有几个级别的调用堆栈,如下所示:

f1:user_func1 
  f2:**user_func2**
    f3:third_party_func1
      f4:third_party_func2
          f5:exception happens here. 
Run Code Online (Sandbox Code Playgroud)

第三方代码中某处发生异常(框架f5)。我使用ipdb进入发生异常的框架,并使用up命令“ u”将调试器带回到我的代码调用第三方代码的框架(框架f2)。

有时第三方代码中有很多级别,因此我需要按多次。有没有办法将调试器快速带入调用第三方代码的代码框架?

Kle*_*eag 5

从ipdb命令行:

ipdb> help up
u(p) [count]
    Move the current frame count (default one) levels up in the
    stack trace (to an older frame).
Run Code Online (Sandbox Code Playgroud)