diff options
author | Zen Lee <53538590+zenlyj@users.noreply.github.com> | 2023-05-15 20:35:33 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-15 08:35:33 -0400 |
commit | 2c9d58563aa8268cdcb2ffa3e72d0776b3cf01ee (patch) | |
tree | 25bccdd9b0b63ef98ac7c259a057a406e35c9aed /pylint | |
parent | 4e48d46b7239c2d7a70a05929fd49595d45cc29f (diff) | |
download | pylint-git-2c9d58563aa8268cdcb2ffa3e72d0776b3cf01ee.tar.gz |
Regression fix for `unused-variable` false negative (#8684)
Diffstat (limited to 'pylint')
-rw-r--r-- | pylint/checkers/variables.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/pylint/checkers/variables.py b/pylint/checkers/variables.py index 2504c0c84..2bd553fa1 100644 --- a/pylint/checkers/variables.py +++ b/pylint/checkers/variables.py @@ -950,6 +950,12 @@ scope_type : {self._atomic.scope_type} return True if isinstance(node, (nodes.ClassDef, nodes.FunctionDef)) and node.name == name: return True + if ( + isinstance(node, nodes.ExceptHandler) + and node.name + and node.name.name == name + ): + return True return False @staticmethod |