我正在尝试调试Python程序,我在函数中插入了一个经典的'import pdb; pdb.set_trace()'行,就在生成堆栈跟踪的调用之前。然而,该调用似乎被忽略,即没有任何反应,我没有得到pdb提示。
在程序的那一点,只有一个活动线程。没有检测到pdb模块的猴子修补。
欢迎任何可能导致调用set_trace被忽略的帮助。谢谢。
平台信息:Debian squeeze + python 2.6.5
代码提取:
import threading
print threading.active_count()
import pdb
print pdb
pdb.set_trace()
print "*****"
root_resource.init_publisher() # before changing uid
输出:
<lots of stuff>
1
<module 'pdb' from '/usr/lib/python2.6/pdb.pyc'>
*****
<stack trace in init_publisher>