diff options
author | Daniel Hahler <git@thequod.de> | 2020-03-10 12:48:35 +0300 |
---|---|---|
committer | Daniel Hahler <git@thequod.de> | 2020-03-10 12:51:56 +0300 |
commit | 5955ad47e4cb2a030593f0d4b300253f9dc58cfb (patch) | |
tree | f7fbdb1aa9552267f669be927accdd948b21874e /sphinx/cmd | |
parent | 46b4f595ca463159898e8581278cab2e26861df1 (diff) |
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).
Diffstat (limited to 'sphinx/cmd')
-rw-r--r-- | sphinx/cmd/build.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/sphinx/cmd/build.py b/sphinx/cmd/build.py index 012fd72ad..263794a5a 100644 --- a/sphinx/cmd/build.py +++ b/sphinx/cmd/build.py @@ -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:')), |