Skip to content

Commit 6d01c48

Browse files
authored
[pyupgrade] Make example error out-of-the-box (UP041) (#19292)
<!-- Thank you for contributing to Ruff/ty! To help us out with reviewing, please consider the following: - Does this pull request include a summary of the change? (See below.) - Does this pull request include a descriptive title? (Please prefix with `[ty]` for ty pull requests.) - Does this pull request include references to any relevant issues? --> ## Summary <!-- What's the purpose of the change? What does it do, and why? --> Part of #18972 This PR makes [timeout-error-alias (UP041)](https://docs.astral.sh/ruff/rules/timeout-error-alias/#timeout-error-alias-up041)'s example error out-of-the-box. [Old example](https://play.ruff.rs/87e20352-d80a-46ec-98a2-6f6ea700438b) ```py raise asyncio.TimeoutError ``` [New example](https://play.ruff.rs/d3b95557-46a2-4856-bd71-30d5f3f5ca44) ```py import asyncio raise asyncio.TimeoutError ``` ## Test Plan <!-- How was it tested? --> N/A, no functionality/tests affected
1 parent 6660b11 commit 6d01c48

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

crates/ruff_linter/src/rules/pyupgrade/rules/timeout_error_alias.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ use crate::{AlwaysFixableViolation, Edit, Fix};
2727
///
2828
/// ## Example
2929
/// ```python
30+
/// import asyncio
31+
///
3032
/// raise asyncio.TimeoutError
3133
/// ```
3234
///

0 commit comments

Comments
 (0)