Skip to content

Remove getattr calls in async transport closing#2928

Merged
adamtheturtle merged 2 commits intomainfrom
adamtheturtle/remove-getattr
Mar 27, 2026
Merged

Remove getattr calls in async transport closing#2928
adamtheturtle merged 2 commits intomainfrom
adamtheturtle/remove-getattr

Conversation

@adamtheturtle
Copy link
Copy Markdown
Member

@adamtheturtle adamtheturtle commented Mar 27, 2026

Summary

  • Add aclose to the AsyncTransport protocol so it's a required method
  • Replace getattr-based conditional closing with direct await self._transport.aclose() in all async clients
  • Remove tests for transports without aclose, since the protocol now requires it

Test plan

  • Pre-commit hooks pass (mypy, pyright, ruff, etc.)

🤖 Generated with Claude Code


Note

Medium Risk
This is a small but potentially breaking API change for consumers providing custom async transports, which must now implement aclose() or client cleanup will fail.

Overview
Async client cleanup is simplified by removing conditional getattr checks and always calling await self._transport.aclose() in AsyncVWS, AsyncCloudRecoService, and AsyncVuMarkService.

AsyncTransport is tightened to require an aclose() method, and the test coverage for transports without aclose is removed accordingly.

Written by Cursor Bugbot for commit 147f2ef. This will update automatically on new commits. Configure here.

adamtheturtle and others added 2 commits March 27, 2026 09:06
Add aclose to the AsyncTransport protocol and call it directly
instead of using getattr to check for its existence.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The AsyncTransport protocol now requires aclose, so these tests
for transports lacking aclose are no longer applicable.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@adamtheturtle adamtheturtle merged commit 366f93e into main Mar 27, 2026
16 checks passed
@adamtheturtle adamtheturtle deleted the adamtheturtle/remove-getattr branch March 27, 2026 09:25
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.

1 participant