mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Ignore bdb.BdbQuit when handling exceptions
`bdb.BdbQuit` is used when quitting the debugger. It should not a) cause the debugger to be started (with `-P` / `--pdb`), and b) not a "crash" to be logged. This helps when using `pdb.set_trace()` manually, and quitting it with `q`. It gets used in `build_main`, and `BuildDoc.run` (distutils command).
This commit is contained in:
parent
46b4f595ca
commit
5955ad47e4
@ -29,6 +29,11 @@ from sphinx.util.docutils import docutils_namespace, patch_docutils
|
||||
|
||||
|
||||
def handle_exception(app: Sphinx, args: Any, exception: BaseException, stderr: IO = sys.stderr) -> None: # NOQA
|
||||
import bdb
|
||||
|
||||
if isinstance(exception, bdb.BdbQuit):
|
||||
return
|
||||
|
||||
if args.pdb:
|
||||
import pdb
|
||||
print(red(__('Exception occurred while building, starting debugger:')),
|
||||
|
Loading…
Reference in New Issue
Block a user