【发布时间】:2022-01-04 19:05:54
【问题描述】:
我正在尝试实现一个自定义调试器功能,它只会在我正在创建的包中满足特定条件时插入断点:
def custom_debug():
if(condition):
return breakpoint()
esle:
pass
但是,当我在另一个文件中导入我的包时:
from my_package import module as m
def test():
print("First")
m.custom_debug()
print("Second")
这会跳过函数并打印两行。我怎样才能让它使用我的自定义函数插入断点?
【问题讨论】:
标签: python debugging remote-debugging vscode-debugger