Python脚本无故掉入pdb
我有一个从 iPython 会话内部调用的 python 函数。
在非常具体的情况下,当某一行中的条件结果为 True 时,脚本始终会进入 pdb 调试模式。
没有任何痕迹或任何其他迹象表明代码有问题,只要我输入 c
继续,代码就会完美地继续。
该脚本不包含任何 import pdb
更不用说 set_trace()
...
有什么想法可以解释这一点吗?
I have a python function that I'm calling from inside an iPython session.
In a very specific situation, in which a conditional in a certain line comes out as True, the script consistently drops into a pdb debug mode.
There is no trace or any other indication of a problem with the code, and as soon as I type c
to continue, the code continues perfectly well.
The script doesn't include any import pdb
not to mention a set_trace()
...
Any ideas what could account for this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
根据您的 ipython 配置,如果引发异常,它会自动进入 PDB。
Depending on your ipython config it automatically goes into PDB if an exception is raised.
好像有一个 import pdb;毕竟,代码中的 pdb.set_trace() 行,由于源代码控制问题,我错过了这一行。
Seems like there was a
import pdb; pdb.set_trace()
line in the code after all, which I missed due to source control issues.