summaryrefslogtreecommitdiff
path: root/pylint/checkers
diff options
context:
space:
mode:
authorJacob Walls <jacobtylerwalls@gmail.com>2022-12-25 04:20:53 -0500
committerGitHub <noreply@github.com>2022-12-25 10:20:53 +0100
commite6f0bc5d32965eef37e498e15f05914d4275afb5 (patch)
treed30acf850b4c0d14252f99e7700357a747a84be3 /pylint/checkers
parent4a5f5be479952d5c865a18520f14db321d2432b2 (diff)
downloadpylint-git-e6f0bc5d32965eef37e498e15f05914d4275afb5.tar.gz
Fix `used-before-assignment` if conditional imports guarded again when used (#7980)
Diffstat (limited to 'pylint/checkers')
-rw-r--r--pylint/checkers/variables.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/pylint/checkers/variables.py b/pylint/checkers/variables.py
index 29911c471..b7e1b1cac 100644
--- a/pylint/checkers/variables.py
+++ b/pylint/checkers/variables.py
@@ -2193,6 +2193,7 @@ class VariablesChecker(BaseChecker):
isinstance(defstmt, (nodes.Import, nodes.ImportFrom))
and isinstance(defstmt.parent, nodes.If)
and in_type_checking_block(defstmt)
+ and not in_type_checking_block(node)
):
defstmt_parent = defstmt.parent