<!-- Thank you for taking the time to report an issue! We're glad to have you involved with Ruff. If you're filing a bug report, please consider including the following information: * List of keywords you searched for before creating this issue. Write them down here so that others can find this issue more easily and help provide feedback. e.g. "RUF001", "unused variable", "Jupyter notebook" * A minimal code snippet that reproduces the bug. * The command you invoked (e.g., `ruff /path/to/file.py --fix`), ideally including the `--isolated` flag. * The current Ruff settings (any relevant sections from your `pyproject.toml`). * The current Ruff version (`ruff --version`). --> Hello, when I run ruff on this code sample, I get F821 and F841 errors: ``` try: raise Exception("test") except Exception as e: print((lambda: e)()) ``` This is the exact output of the `ruff check sample.py` command (using the current ruff version, i.e. 0.7.4): ``` sample.py:3:21: F841 [*] Local variable `e` is assigned to but never used | 1 | try: 2 | raise Exception("test") 3 | except Exception as e: | ^ F841 4 | print((lambda: e)()) | = help: Remove assignment to unused variable `e` sample.py:4:20: F821 Undefined name `e` | 2 | raise Exception("test") 3 | except Exception as e: 4 | print((lambda: e)()) | ^ F821 | Found 2 errors. [*] 1 fixable with the `--fix` option. ``` I believe that this is a false positive, as this code runs fine on cPython 3.9. It prints "test".