Skip to content

Commit

Permalink
fix warning message to refer to anyio.maybe_async
Browse files Browse the repository at this point in the history
  • Loading branch information
graingert committed May 12, 2021
1 parent 6fffa99 commit 9b14209
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/anyio/_core/_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def maybe_async_cm(cm: Union[ContextManager[T], AsyncContextManager[T]]) -> Asyn

def _warn_deprecation(awaitable: AnyDeprecatedAwaitable, stacklevel: int = 1) -> None:
warn(f'Awaiting on {awaitable._name}() is deprecated. Use "await '
f'anyio.maybe_awaitable({awaitable._name}(...)) if you have to support both AnyIO 2.x '
f'anyio.maybe_async({awaitable._name}(...)) if you have to support both AnyIO 2.x '
f'and 3.x, or just remove the "await" if you are completely migrating to AnyIO 3+.',
DeprecationWarning, stacklevel=stacklevel + 1)

Expand Down

0 comments on commit 9b14209

Please sign in to comment.