Skip to content

Add IPython integration#152

Open
darshan-Jahagirdar wants to merge 1 commit into
Qix-:masterfrom
darshan-Jahagirdar:codex/ipython-integration
Open

Add IPython integration#152
darshan-Jahagirdar wants to merge 1 commit into
Qix-:masterfrom
darshan-Jahagirdar:codex/ipython-integration

Conversation

@darshan-Jahagirdar

Copy link
Copy Markdown

Fixes #10.

IssueHunt: https://oss.issuehunt.io/r/Qix-/better-exceptions/issues/10

Summary:

  • Add an IPython integration module that patches IPython's showtraceback hook.
  • Expose the integration as an IPython extension via %load_ext better_exceptions.integrations.ipython.
  • Preserve IPython's original traceback handling for syntax errors and special traceback modes.
  • Document IPython usage in the README.

Notes:

  • AI-assisted with OpenAI Codex; I reviewed the implementation and tests.

Verification:

  • PYTHONPATH=. python test/test_ipython.py
  • PYTHONPATH=. python test/test_logging.py
  • python -m py_compile better_exceptions/integrations/ipython.py test/test_ipython.py
  • Real IPython 9.13.0 extension smoke test with InteractiveShell.instance()
  • git diff --check

@darshan-Jahagirdar

Copy link
Copy Markdown
Author

Validation update for this PR:

py -3.11 -B test\test_ipython.py
git diff --check

Result: both passed.

Notes: I used Python 3.11 because Python 3.14 no longer includes distutils, which this older package still imports in setup.py. On Windows the package imports colorama, so I installed colorama into a temporary test-only directory via pip --target, added that directory to PYTHONPATH, ran the test, and removed the temp directory afterward.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ipython support

1 participant