Skip to content

fix: fix DeprecationWarning for asyncio.iscoroutinefunction#4075

Open
jules-ch wants to merge 2 commits into
redis:masterfrom
jules-ch:fix-deprecation-warning-asyncio-iscoroutine-function
Open

fix: fix DeprecationWarning for asyncio.iscoroutinefunction#4075
jules-ch wants to merge 2 commits into
redis:masterfrom
jules-ch:fix-deprecation-warning-asyncio-iscoroutine-function

Conversation

@jules-ch
Copy link
Copy Markdown

@jules-ch jules-ch commented May 20, 2026

Description of change

Small PR to handle deprecation in Python3.14

asyncio.iscoroutinefunction is deprecated in favor of inspect.iscoroutinefunction

Screenshot from 2026-05-20 20-39-00

Pull Request check-list

Please make sure to review and check all of these items:

  • Do tests and lints pass with this change?
  • Do the CI tests pass with this change (enable it first in your forked repo and wait for the github action build to finish)?
  • Is the new or changed code fully tested?
  • Is a documentation update included (if this change modifies existing APIs, or introduces new ones)?
  • Is there an example added to the examples folder (if applicable)?

NOTE: these things are not required to open a PR and can be done
afterwards / while the PR is open.


Note

Low Risk
Low risk compatibility change that only affects coroutine detection paths; behavior should remain equivalent but could differ for edge-case callables on newer Python versions.

Overview
Updates async coroutine detection to avoid Python 3.14 deprecation warnings by switching from asyncio.iscoroutinefunction to inspect.iscoroutinefunction.

This affects both connection setup when calling a custom redis_connect_func (redis/asyncio/connection.py) and async multidb pubsub method execution (redis/asyncio/multidb/command_executor.py).

Reviewed by Cursor Bugbot for commit 454b21f. Bugbot is set up for automated code reviews on this repo. Configure here.

@jit-ci
Copy link
Copy Markdown

jit-ci Bot commented May 20, 2026

Hi, I’m Jit, a friendly security platform designed to help developers build secure applications from day zero with an MVS (Minimal viable security) mindset.

In case there are security findings, they will be communicated to you as a comment inside the PR.

Hope you’ll enjoy using Jit.

Questions? Comments? Want to learn more? Get in touch with us.

@jules-ch jules-ch force-pushed the fix-deprecation-warning-asyncio-iscoroutine-function branch from ad5b01c to 616b1ee Compare May 20, 2026 18:45
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