mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Merge pull request #7349 from tk0miya/7290_import_first
refactor: Import libraries at the top of script (if no reason)
This commit is contained in:
commit
dd85cb6588
@ -9,9 +9,11 @@
|
||||
"""
|
||||
|
||||
import argparse
|
||||
import bdb
|
||||
import locale
|
||||
import multiprocessing
|
||||
import os
|
||||
import pdb
|
||||
import sys
|
||||
import traceback
|
||||
from typing import Any, IO, List
|
||||
@ -29,13 +31,10 @@ 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:')),
|
||||
file=stderr)
|
||||
traceback.print_exc()
|
||||
|
Loading…
Reference in New Issue
Block a user