Skip to content

refactor: import SSEError from httpx_sse public API#2560

Merged
maxisbey merged 1 commit intomainfrom
fix/sse-import-public-api
May 8, 2026
Merged

refactor: import SSEError from httpx_sse public API#2560
maxisbey merged 1 commit intomainfrom
fix/sse-import-public-api

Conversation

@maxisbey
Copy link
Copy Markdown
Contributor

@maxisbey maxisbey commented May 8, 2026

src/mcp/client/sse.py imports SSEError from the private httpx_sse._exceptions submodule (introduced in #975). SSEError is part of httpx-sse's public API — re-exported at the package top level and listed in __all__ in every release ≥0.4.0 — so this switches to the public path.

Motivation and Context

Underscore-prefixed modules are private; httpx-sse could reorganise _exceptions.py in any patch release without it being a breaking change. The public re-export is the stable surface.

Surfaced while investigating #2543.

How Has This Been Tested?

Verified from httpx_sse import SSEError works against every published httpx-sse ≥0.4 (0.4.0, 0.4.1, 0.4.2, 0.4.3) and that it resolves to the identical class object as the private path. CI's lowest-direct matrix exercises httpx-sse==0.4.0 directly.

Breaking Changes

None — same class object, no behaviour change.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

AI Disclaimer

`SSEError` is re-exported at the `httpx_sse` package top level and
listed in `__all__` in every release >=0.4.0; the `_exceptions`
submodule is private. Importing via the public path avoids breakage if
httpx-sse reorganises its internals.

No behaviour change (same class object).
@maxisbey maxisbey marked this pull request as ready for review May 8, 2026 14:03
@maxisbey maxisbey enabled auto-merge (squash) May 8, 2026 16:33
Copy link
Copy Markdown
Contributor

@bhosmer-ant bhosmer-ant left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified SSEError is re-exported and listed in __all__ at the httpx-sse>=0.4 floor (0.4.0), so this is safe across the full supported range. Same class object, no behaviour change. lowest-direct matrix legs confirm.


Generated by Claude Code

@maxisbey maxisbey merged commit 161834d into main May 8, 2026
51 of 52 checks passed
@maxisbey maxisbey deleted the fix/sse-import-public-api branch May 8, 2026 16:42
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.

2 participants