◐ Shell
clean mode source ↗

refactor: import SSEError from httpx_sse public API by maxisbey · Pull Request #2560 · modelcontextprotocol/python-sdk

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