Skip to content

Commit

Permalink
Fixed documentation by removing obsolete reference.
Browse files Browse the repository at this point in the history
Python 3.11 has removed support for `@asyncio.coroutine` and with it
removed the documentation references for `asyncio.iscoroutinefunction()`
such that the intersphinx reference is unavailable.

The implementation of `asyncio.iscoroutinefunction()` still exists,
however:

https://github.com/python/cpython/blob/a1092f62492a3fcd6195bea94eccf8d5a300acb1/Lib/asyncio/coroutines.py#L21-L24

It looks as though it will be removed in the future:

python/cpython#94912

As we still need to support Python < 3.11 where `@asyncio.coroutine` may
be used we will likely need to vendor this until Python 3.11 is the
minimum supported version when `inspect.iscoroutinefunction()` can be
used directly instead. That will likely not be required until 3.12
though.
  • Loading branch information
ngnpope committed Oct 28, 2022
1 parent 37c5b8c commit 245d240
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/topics/http/middleware.txt
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ If your middleware has both ``sync_capable = True`` and
``async_capable = True``, then Django will pass it the request without
converting it. In this case, you can work out if your middleware will receive
async requests by checking if the ``get_response`` object you are passed is a
coroutine function, using :py:func:`asyncio.iscoroutinefunction`.
coroutine function, using ``asyncio.iscoroutinefunction``.

The ``django.utils.decorators`` module contains
:func:`~django.utils.decorators.sync_only_middleware`,
Expand Down

0 comments on commit 245d240

Please sign in to comment.