-
Notifications
You must be signed in to change notification settings - Fork 805
Replace asyncio.iscoroutinefunction with inspect.iscoroutinefunction #3880
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Replace asyncio.iscoroutinefunction with inspect.iscoroutinefunction #3880
Conversation
3c95d5f to
cb8c198
Compare
cb8c198 to
0d560f9
Compare
| from __future__ import annotations | ||
|
|
||
| from asyncio import iscoroutinefunction | ||
| from inspect import iscoroutinefunction |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This breaks something, could you please take a look at the failing tests?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup I’ll fix!
|
Hm the failing test is a bug in CPython where an Here's a debug session that shows live variables and illustrates the problem:
I guess we could special case for Python 3.9, but I assume in the near term otel will drop Python 3.9 compatibility since it's EOL? The particularly annoying part is that this only shows up in Our options as I see it:
I kind of think we should do (1) |
|
@xrmx I added what I think is a reasonable fix given the Python 3.9 status, LMK if you'd like a different change! |

Description
asyncio.iscoroutinefunctionis officially deprecated in 3.14,inspect.iscoroutinefunctionhas been around since 3.5Fixes #3879
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Does This PR Require a Core Repo Change?
Checklist:
See contributing.md for styleguide, changelog guidelines, and more.