prompt-toolkit / python-prompt-toolkit

Library for building powerful interactive command line applications in Python
https://python-prompt-toolkit.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
9.11k stars 717 forks source link

Honoring custom pythonbreakpoint environment variable #1766

Open dgilroy opened 11 months ago

dgilroy commented 11 months ago

I use a custom debugger that is set in my environment by the PYTHONBREAKPOINT environment variable.

However, PT 3.0.39 is overriding this choice due to how Application._enable_breakpointhook is being implemented

Specifically, it is checking whether "sys.breakpointhook == sys.breakpointhook" and then setting the debugger to PDB. However, it seems that since I'm using an envvar that this check evaluates to True despite the fact that I am using a custom hook.