summaryrefslogtreecommitdiff
path: root/pylint
diff options
context:
space:
mode:
authorZen Lee <53538590+zenlyj@users.noreply.github.com>2023-05-15 20:35:33 +0800
committerGitHub <noreply@github.com>2023-05-15 08:35:33 -0400
commit2c9d58563aa8268cdcb2ffa3e72d0776b3cf01ee (patch)
tree25bccdd9b0b63ef98ac7c259a057a406e35c9aed /pylint
parent4e48d46b7239c2d7a70a05929fd49595d45cc29f (diff)
downloadpylint-git-2c9d58563aa8268cdcb2ffa3e72d0776b3cf01ee.tar.gz
Regression fix for `unused-variable` false negative (#8684)
Diffstat (limited to 'pylint')
-rw-r--r--pylint/checkers/variables.py6
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