大致结构如下,希望进入 pdb 调试后,可以从出错处继续运行,有什么办法吗?
def main():
# ...
def test(func):
import sys
import traceback
import pdb
try:
func()
except Exception:
type, value, tb = sys.exc_info()
traceback.print_exc()
pdb.post_mortem(tb)
if __name__ == '__main__':
test(main)
1
wellsc 2017-09-20 23:04:38 +08:00
试试 set_trace() ?
|