Skip to content

fix: aiohttp interceptor compatibility with aiohttp 4.x#179

Open
ChaitanyaKhoje wants to merge 1 commit intoh2non:masterfrom
ChaitanyaKhoje:fix/aiohttp-4-compatibility
Open

fix: aiohttp interceptor compatibility with aiohttp 4.x#179
ChaitanyaKhoje wants to merge 1 commit intoh2non:masterfrom
ChaitanyaKhoje:fix/aiohttp-4-compatibility

Conversation

@ChaitanyaKhoje
Copy link
Copy Markdown

Problem

aiohttp.ClientHandlerType was removed in aiohttp 4.0, causing an AttributeError when pook's aiohttp interceptor is loaded with aiohttp 4.x installed.

Affected line: src/pook/interceptors/aiohttp.py — the __call__ signature uses aiohttp.ClientHandlerType as a type annotation.

Fix

Replace aiohttp.ClientHandlerType with Callable from typing, which is the correct approach for aiohttp 4.x and remains backwards compatible.

Reproduction

Pin aiohttp>=4 and run any test suite that imports pook's aiohttp interceptor — test collection will fail.

Workaround used downstream: pin aiohttp<4

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