Skip to content

Replace deprecated asyncio.iscoroutinefunction with inspect.iscoroutinefunction#69581

Merged
dwoz merged 1 commit into
masterfrom
fix/issue-69580
Jun 29, 2026
Merged

Replace deprecated asyncio.iscoroutinefunction with inspect.iscoroutinefunction#69581
dwoz merged 1 commit into
masterfrom
fix/issue-69580

Conversation

@dwoz

@dwoz dwoz commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Summary

  • 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 #69580

Test plan

  • pytest tests/pytests/unit/cluster/consensus/test_raft_scheduler.py — 16 tests pass including new test_async_scheduler_no_deprecation_warning_for_coroutine_callback
  • pytest tests/pytests/unit/utils/event/test_salt_event_schedule.py — 2 new tests pass

…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 #69580
@dwoz dwoz merged commit 8b6c861 into master Jun 29, 2026
963 of 970 checks passed
@dwoz dwoz deleted the fix/issue-69580 branch June 29, 2026 19:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test:full Run the full test suite

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bug] fix deprecation warning

2 participants