---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
---
<filename>:7:26: F841 [*] Local variable `x` is assigned to but never used
  |
5 |     try:
6 |         1 / 0
7 |     except ValueError as x:
  |                          ^ F841
8 |         pass
9 |     except ImportError as x:
  |
  = help: Remove assignment to unused variable `x`

ℹ Safe fix
4 4 | 
5 5 |     try:
6 6 |         1 / 0
7   |-    except ValueError as x:
  7 |+    except ValueError:
8 8 |         pass
9 9 |     except ImportError as x:
10 10 |         pass

<filename>:9:27: F841 [*] Local variable `x` is assigned to but never used
   |
 7 |     except ValueError as x:
 8 |         pass
 9 |     except ImportError as x:
   |                           ^ F841
10 |         pass
   |
   = help: Remove assignment to unused variable `x`

ℹ Safe fix
6  6  |         1 / 0
7  7  |     except ValueError as x:
8  8  |         pass
9     |-    except ImportError as x:
   9  |+    except ImportError:
10 10 |         pass
11 11 | 
12 12 |     # No error here, though it should arguably be an F821 error. `x` will


