summaryrefslogtreecommitdiff
path: root/pylint/checkers/variables.py
diff options
context:
space:
mode:
Diffstat (limited to 'pylint/checkers/variables.py')
-rw-r--r--pylint/checkers/variables.py5
1 files changed, 1 insertions, 4 deletions
diff --git a/pylint/checkers/variables.py b/pylint/checkers/variables.py
index 254ef5f5a..e1b82bb41 100644
--- a/pylint/checkers/variables.py
+++ b/pylint/checkers/variables.py
@@ -2497,10 +2497,7 @@ class VariablesChecker(BaseChecker):
# the usage is safe because the function will not be defined either if
# the variable is not defined.
scope = node.scope()
- # FunctionDef subclasses Lambda due to a curious ontology. Check both.
- # See https://github.com/pylint-dev/astroid/issues/291
- # TODO: Revisit when astroid 3.0 includes the change
- if isinstance(scope, nodes.Lambda) and any(
+ if isinstance(scope, (nodes.Lambda, nodes.FunctionDef)) and any(
asmt.scope().parent_of(scope) for asmt in astmts
):
return