# RuntimeError: 无法复用已经 await 过的协程

- **ID:** `python/asyncio-cannot-run-coroutine-already-running`
- **领域:** python
- **类别:** runtime_error
- **验证级别:** ai_generated
- **修复率:** 80%

## 根因

同一个协程对象被 await 了多次。Python 中的协程是一次性的；在重试循环中复用同一个协程对象或将其缓存到变量后重复 await 都会触发此错误。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| 3.8 | active | — | — |
| 3.9 | active | — | — |
| 3.10 | active | — | — |
| 3.11 | active | — | — |
| 3.12 | active | — | — |

## 解决方案

1. **** (95% 成功率)
   ```
   async def fetch(): ...
for _ in range(3):
    await fetch()   # new coroutine each iteration
   ```
2. **** (85% 成功率)
   ```
   task = asyncio.ensure_future(fetch())
await task
await task   # Tasks can be awaited multiple times
   ```
3. **** (88% 成功率)
   ```
   from functools import partial
make = partial(fetch, url)
await make()
await make()
   ```

## 无效尝试

- **** — The coroutine frame is exhausted; send raises StopIteration immediately. (95% 失败率)
- **** — Shallow copy shares the same frame; awaiting the copy raises the same error. (90% 失败率)
