Skip to content

Conversation

@jonathan343
Copy link
Contributor

Summary

Starting in Python 3.14, the following DeprecationWarning is thrown when using asyncio.iscoroutinefunction:

  /Users/gytndd/dev/GitHub/aws-sdk-python/clients/aws-sdk-bedrock-runtime/.venv/lib/python3.14/site-packages/smithy_core/aio/types.py:60: DeprecationWarning: 'asyncio.iscoroutinefunction' is deprecated and slated for removal in Python 3.16; use inspect.iscoroutinefunction() instead
    if isinstance(self._data, BytesReader) and not iscoroutinefunction(  # type: ignore - TODO(pyright)

asyncio.iscoroutinefunction() is deprecated and will be removed in Python 3.16; use inspect.iscoroutinefunction() instead. (Contributed by Jiahao Li and Kumar Aditya in gh-122875.)

Ref: https://docs.python.org/3/deprecations/index.html#pending-removal-in-python-3-16

Following the guidance provided above, this PR cleans up all existing instances of asyncio.iscoroutinefunction (e.g., from asyncio import iscoroutinefunction) and replaces them with inspect.iscoroutinefunction.


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@jonathan343 jonathan343 requested a review from a team as a code owner November 25, 2025 07:26
nateprewitt
nateprewitt previously approved these changes Nov 25, 2025
@jonathan343 jonathan343 merged commit bbdc668 into develop Nov 25, 2025
6 checks passed
@jonathan343 jonathan343 deleted the iscoroutinefunction-warning branch November 25, 2025 18:14
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