diff options
author | Jacob Walls <jacobtylerwalls@gmail.com> | 2022-09-24 08:49:01 -0400 |
---|---|---|
committer | Jacob Walls <jacobtylerwalls@gmail.com> | 2022-09-28 16:41:09 -0400 |
commit | 530d79051fc2d63512808f40032729b5e18f4769 (patch) | |
tree | bdaeca8294c1c3b6852cee79c40a5c89ec4ea922 /pylint | |
parent | 51a5850234e12455fc29824cbacf680d7d439033 (diff) | |
download | pylint-git-530d79051fc2d63512808f40032729b5e18f4769.tar.gz |
Prevent `redefined-outer-name` for `if t.TYPE_CHECKING`
Diffstat (limited to 'pylint')
-rw-r--r-- | pylint/checkers/variables.py | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/pylint/checkers/variables.py b/pylint/checkers/variables.py index a62d2362f..7be3916a7 100644 --- a/pylint/checkers/variables.py +++ b/pylint/checkers/variables.py @@ -1230,9 +1230,7 @@ class VariablesChecker(BaseChecker): # Do not take in account redefined names for the purpose # of type checking.: if any( - isinstance(definition.parent, nodes.If) - and definition.parent.test.as_string() in TYPING_TYPE_CHECKS_GUARDS - for definition in globs[name] + in_type_checking_block(definition) for definition in globs[name] ): continue |