mirror of
https://github.com/astral-sh/ruff.git
synced 2025-11-02 04:48:06 +00:00
Previously, this lint had its alias detection logic a little backwards. That is, for Python 3.11+, it would *only* detect asyncio.TimeoutError as an alias, but it should have also detected socket.timeout as an alias. And in Python <3.11, it would falsely detect asyncio.TimeoutError as an alias where it should have only detected socket.timeout as an alias. We fix it so that both asyncio.TimeoutError and socket.timeout are detected as aliases in Python 3.11+, and only socket.timeout is detected as an alias in Python 3.10. Fixes #8565 ## Test Plan I tested this by updating the existing snapshot test which had erroneously asserted that socket.timeout should not be replaced with TimeoutError in Python 3.11+. I also added a new regression test that targets Python 3.10 and ensures that the suggestion to replace asyncio.TimeoutError with TimeoutError does not occur. |
||
|---|---|---|
| .. | ||
| resources/test | ||
| src | ||
| Cargo.toml | ||