diff --git a/asgiref/timeout.py b/asgiref/timeout.py index d3fbca8b..6e5086f4 100644 --- a/asgiref/timeout.py +++ b/asgiref/timeout.py @@ -7,6 +7,7 @@ import asyncio +import warnings from types import TracebackType from typing import Any, Optional, Type @@ -35,6 +36,10 @@ def __init__( self._timeout = timeout if loop is None: loop = asyncio.get_running_loop() + else: + warnings.warn( + """The loop argument to timeout() is deprecated.""", DeprecationWarning + ) self._loop = loop self._task = None # type: Optional[asyncio.Task[Any]] self._cancelled = False