debugger: load 'ipdb' if present

Transparently chooses between the IPython-enhanced 'ipdb' or the
standard 'pdb'.
pull/2342/head
Tiago Ilieve 2024-05-06 11:37:17 -03:00
rodzic 8f9509f00c
commit f4c62bf902
2 zmienionych plików z 7 dodań i 3 usunięć

Wyświetl plik

@ -5,9 +5,13 @@ from .utils.asgi import (
)
from .views.base import DatasetteError
from markupsafe import Markup
import pdb
import traceback
try:
import ipdb as pdb
except ImportError:
import pdb
try:
import rich
except ImportError:

Wyświetl plik

@ -111,7 +111,7 @@ Debugging
Any errors that occur while Datasette is running while display a stack trace on the console.
You can tell Datasette to open an interactive ``pdb`` debugger session if an error occurs using the ``--pdb`` option::
You can tell Datasette to open an interactive ``pdb`` (or ``ipdb``, if present) debugger session if an error occurs using the ``--pdb`` option::
datasette --pdb fixtures.db
@ -345,4 +345,4 @@ Datasette bundles `CodeMirror <https://codemirror.net/>`__ for the SQL editing i
-p @rollup/plugin-node-resolve \
-p @rollup/plugin-terser
* Update the version reference in the ``codemirror.html`` template.
* Update the version reference in the ``codemirror.html`` template.