Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ jobs:
cd src
python --version # just to make sure we're running the right one
# Run tests under coverage
python -m coverage run -m unittest test_typing_extensions.py
python -We -m coverage run -m unittest test_typing_extensions.py
# Create xml file for Codecov
coverage xml --rcfile=../pyproject.toml --fail-under=0
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# Unreleased

- Avoid a `DeprecationWarning` when applying `deprecated` to a coroutine function on
Python 3.14.0.

# Release 4.16.0rc1 (June 24, 2026)

- Make `typing_extensions.TypeAliasType`'s `__module__` attribute writable.
Expand Down
5 changes: 3 additions & 2 deletions src/typing_extensions.py
Original file line number Diff line number Diff line change
Expand Up @@ -3130,7 +3130,6 @@ def __init_subclass__(cls, *args, **kwargs):
__init_subclass__.__deprecated__ = msg
return arg
elif callable(arg):
import asyncio.coroutines
import functools
import inspect

Expand All @@ -3139,11 +3138,13 @@ def wrapper(*args, **kwargs):
warnings.warn(msg, category=category, stacklevel=stacklevel + 1)
return arg(*args, **kwargs)

if asyncio.coroutines.iscoroutinefunction(arg):
if inspect.iscoroutinefunction(arg):
# Breakpoint: https://github.com/python/cpython/pull/99247
if sys.version_info >= (3, 12):
wrapper = inspect.markcoroutinefunction(wrapper)
else:
import asyncio.coroutines

wrapper._is_coroutine = asyncio.coroutines._is_coroutine

arg.__deprecated__ = wrapper.__deprecated__ = msg
Expand Down
Loading