diff options
author | Jacob Walls <jacobtylerwalls@gmail.com> | 2022-07-09 16:22:57 -0400 |
---|---|---|
committer | Jacob Walls <jacobtylerwalls@gmail.com> | 2022-07-09 17:31:32 -0400 |
commit | 18af074124745bb228f2954e390cea9ad3f9c268 (patch) | |
tree | acc897b5724ef7dc8298c979460af629da39c8ec /astroid/inference.py | |
parent | 98c8f61cc00808f7caba99c6805b90f9ffacfb0a (diff) | |
download | astroid-git-18af074124745bb228f2954e390cea9ad3f9c268.tar.gz |
Fix a crash involving properties within `if` blocks
Diffstat (limited to 'astroid/inference.py')
-rw-r--r-- | astroid/inference.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/astroid/inference.py b/astroid/inference.py index 7286b68c..d9b7ac0e 100644 --- a/astroid/inference.py +++ b/astroid/inference.py @@ -1153,7 +1153,7 @@ def infer_functiondef( isinstance(val, objects.Property) for val in parent_frame.locals[self.name] ) # We also don't want to pass parent if the definition is within a Try node - if isinstance(self.parent, (nodes.TryExcept, nodes.TryFinally)): + if isinstance(self.parent, (nodes.TryExcept, nodes.TryFinally, nodes.If)): property_already_in_parent_locals = True prop_func = objects.Property( |