---
source: crates/ruff_linter/src/rules/pyupgrade/mod.rs
---
UP024 [*] Replace aliased errors with `OSError`
 --> UP024_1.py:5:8
  |
3 | try:
4 |     pass
5 | except (OSError, mmap.error, IOError):
  |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6 |     pass
7 | except (OSError, socket.error, KeyError):
  |
help: Replace with builtin `OSError`
  |
4 |     pass
  - except (OSError, mmap.error, IOError):
5 + except OSError:
6 |     pass
  |

UP024 [*] Replace aliased errors with `OSError`
 --> UP024_1.py:7:8
  |
5 | except (OSError, mmap.error, IOError):
6 |     pass
7 | except (OSError, socket.error, KeyError):
  |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
8 |     pass
  |
help: Replace with builtin `OSError`
  |
6 |     pass
  - except (OSError, socket.error, KeyError):
7 + except (OSError, KeyError):
8 |     pass
  |

UP024 [*] Replace aliased errors with `OSError`
  --> UP024_1.py:12:8
   |
10 |   try:
11 |       pass
12 |   except (
   |  ________^
13 | |     OSError,
14 | |     select.error,
15 | |     IOError,
16 | | ):
   | |_^
17 |       pass
   |
help: Replace with builtin `OSError`
   |
11 |     pass
   - except (
   -     OSError,
   -     select.error,
   -     IOError,
   - ):
12 + except OSError:
13 |     pass
   |
