[3008.x] Replace deprecated asyncio.iscoroutinefunction with inspect.iscoroutinefunction (#69580)#69601
Open
dwoz wants to merge 1 commit into
Open
Conversation
…nefunction asyncio.iscoroutinefunction() was deprecated in Python 3.12 and is slated for removal in Python 3.16. Replace it with inspect.iscoroutinefunction() in salt/utils/event.py and salt/cluster/consensus/raft/scheduler.py. Add tests that verify no DeprecationWarning is emitted when scheduling coroutine callbacks. Fixes saltstack#69580
twangboy
approved these changes
Jun 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Backport of #69581 to
3008.x.asyncio.iscoroutinefunction()was deprecated in Python 3.12 and is slated for removal in Python 3.16. This PR replaces it withinspect.iscoroutinefunction()in:salt/utils/event.pysalt/cluster/consensus/raft/scheduler.pyTests are added that verify no
DeprecationWarningis emitted when scheduling coroutine callbacks throughSaltEvent._scheduleandAsyncTimeoutScheduler.schedule.Why a sibling PR?
The original PR #69581 was merged to
master(Potassium), but issue #69580 explicitly states:So the master merge alone does not address the issue. This PR is the sibling backport that lands the same fix on
3008.x(Argon).Related
Commits
Test plan