---
source: crates/ruff_linter/src/rules/pyupgrade/mod.rs
---
UP041 [*] Replace aliased errors with `TimeoutError`
  --> UP041.py:10:8
   |
 8 | try:
 9 |     pass
10 | except socket.timeout:
   |        ^^^^^^^^^^^^^^
11 |     pass
   |
help: Replace `socket.timeout` with builtin `TimeoutError`
   |
9  |     pass
   - except socket.timeout:
10 + except TimeoutError:
11 |     pass
   |

UP041 [*] Replace aliased errors with `TimeoutError`
  --> UP041.py:22:8
   |
20 | try:
21 |     pass
22 | except (socket.timeout,):
   |        ^^^^^^^^^^^^^^^^^
23 |     pass
   |
help: Replace with builtin `TimeoutError`
   |
21 |     pass
   - except (socket.timeout,):
22 + except TimeoutError:
23 |     pass
   |

UP041 [*] Replace aliased errors with `TimeoutError`
  --> UP041.py:27:8
   |
25 | try:
26 |     pass
27 | except (asyncio.TimeoutError, socket.timeout,):
   |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
28 |     pass
   |
help: Replace with builtin `TimeoutError`
   |
26 |     pass
   - except (asyncio.TimeoutError, socket.timeout,):
27 + except (TimeoutError, asyncio.TimeoutError):
28 |     pass
   |

UP041 [*] Replace aliased errors with `TimeoutError`
  --> UP041.py:34:8
   |
32 | try:
33 |     pass
34 | except (asyncio.TimeoutError, socket.timeout, KeyError, TimeoutError):
   |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
35 |     pass
   |
help: Replace with builtin `TimeoutError`
   |
33 |     pass
   - except (asyncio.TimeoutError, socket.timeout, KeyError, TimeoutError):
34 + except (asyncio.TimeoutError, KeyError, TimeoutError):
35 |     pass
   |
