我正在使用 Tornado ioloop 开发应用程序,当涉及到http_client.fetch
'scallback
时,我想用 启动 pdb import pdb; pdb.set_trace()
,但是引发了异常:
> /home/yiwei.liyw/dsa-engine/src/collect/engine_task.py(52)task_created()
-> print response.body
(Pdb)
2015-10-26 15:30:38,629 ERROR ioloop.py:612 Exception in callback <functools.partial object at 0x7fe0d98e5e68>
Traceback (most recent call last):
File "/home/yiwei.liyw/dsa-engine/venv/lib/python2.7/site-packages/tornado/ioloop.py", line 592, in _run_callback
ret = callback()
File "/home/yiwei.liyw/dsa-engine/venv/lib/python2.7/site-packages/tornado/stack_context.py", line 275, in null_wrapper
return fn(*args, **kwargs)
File "/home/yiwei.liyw/dsa-engine/src/collect/engine_task.py", line 52, in task_created
print response.body
File "/home/yiwei.liyw/dsa-engine/src/collect/engine_task.py", line 52, in task_created
print response.body
File "/home/tops/lib/python2.7/bdb.py", line 49, in trace_dispatch
return self.dispatch_line(frame)
File "/home/tops/lib/python2.7/bdb.py", line 68, in dispatch_line
if self.quitting: raise BdbQuit
BdbQuit
在 Tornado 应用程序中使用 pdb 的最佳方法是什么?