If run debugpy with --wait-for-client, the program stops and wait for connection. After client's connection, breakpoint() makes program stop, and also raised exceptions if Raised Exceptions is checked in VSCode.
But in my use cases, I don't want to use --wait-for-client as it stops the whole thing. I just want to debug the program if something goes wrong, such as assertions failed. If nothing goes wrong, the program proceeds normally to the end.
For example, this program
# foo.py
x=1
assert x==0
x=2
Run it with python -m debugpy --listen 1234 foo.py. The program did not stop at assert x==0, but this uncaught exception make it exit.
If run debugpy with
--wait-for-client, the program stops and wait for connection. After client's connection, breakpoint() makes program stop, and also raised exceptions ifRaised Exceptionsis checked in VSCode.But in my use cases, I don't want to use
--wait-for-clientas it stops the whole thing. I just want to debug the program if something goes wrong, such as assertions failed. If nothing goes wrong, the program proceeds normally to the end.For example, this program
Run it with
python -m debugpy --listen 1234 foo.py. The program did not stop atassert x==0, but this uncaught exception make it exit.