mirror of
https://github.com/astral-sh/ruff.git
synced 2025-10-01 14:21:24 +00:00
[flake8-async
] Fix examples to use async with
(#12924)
This commit is contained in:
parent
d8debb7a36
commit
9b73532b11
2 changed files with 3 additions and 3 deletions
|
@ -32,7 +32,7 @@ use crate::rules::flake8_async::helpers::AsyncModule;
|
||||||
///
|
///
|
||||||
///
|
///
|
||||||
/// async def main():
|
/// async def main():
|
||||||
/// with asyncio.timeout(2):
|
/// async with asyncio.timeout(2):
|
||||||
/// await long_running_task()
|
/// await long_running_task()
|
||||||
/// ```
|
/// ```
|
||||||
///
|
///
|
||||||
|
|
|
@ -22,14 +22,14 @@ use crate::rules::flake8_async::helpers::MethodName;
|
||||||
/// ## Example
|
/// ## Example
|
||||||
/// ```python
|
/// ```python
|
||||||
/// async def func():
|
/// async def func():
|
||||||
/// with asyncio.timeout(2):
|
/// async with asyncio.timeout(2):
|
||||||
/// do_something()
|
/// do_something()
|
||||||
/// ```
|
/// ```
|
||||||
///
|
///
|
||||||
/// Use instead:
|
/// Use instead:
|
||||||
/// ```python
|
/// ```python
|
||||||
/// async def func():
|
/// async def func():
|
||||||
/// with asyncio.timeout(2):
|
/// async with asyncio.timeout(2):
|
||||||
/// do_something()
|
/// do_something()
|
||||||
/// await awaitable()
|
/// await awaitable()
|
||||||
/// ```
|
/// ```
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue