Skip to content

Conversation

@rejus-b
Copy link
Contributor

@rejus-b rejus-b commented Feb 24, 2025

As the title suggests using if inspect.iscoroutinefunction(resp.json): over if inspect.isawaitable(resp.json): for checking whether the function is asynchronous for the form required when working with aiohttp.

This change has been made because using isawaitable creates unawaited coroutines when checking for the awaitability, giving a warning when code is ran using aiohttp. It should not affect Httpx and asks.

@Waester
Copy link

Waester commented Jan 10, 2026

Summoning @kipe

LGTM

Fixes following warning:
/home/REDACTED/venv/lib/python3.13/site-packages/nordpool/elspot.py:280: RuntimeWarning: coroutine 'ClientResponse.json' was never awaited if inspect.isawaitable(resp.json()):

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