Skip to content

Commit

Permalink
debugger: load 'ipdb' if present
Browse files Browse the repository at this point in the history
Transparently chooses between the IPython-enhanced 'ipdb' or the
standard 'pdb'.
  • Loading branch information
myhro committed May 6, 2024
1 parent 8f9509f commit f4c62bf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion datasette/handle_exception.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,13 @@
)
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:
Expand Down
4 changes: 2 additions & 2 deletions docs/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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.

0 comments on commit f4c62bf

Please sign in to comment.