diff options
Diffstat (limited to 'astroid/protocols.py')
-rw-r--r-- | astroid/protocols.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/astroid/protocols.py b/astroid/protocols.py index 228000ab..f97fb948 100644 --- a/astroid/protocols.py +++ b/astroid/protocols.py @@ -839,8 +839,10 @@ def match_as_assigned_stmts( """Infer MatchAs as the Match subject if it's the only MatchCase pattern else raise StopIteration to yield Uninferable. """ - if isinstance(self.parent, nodes.MatchCase) and isinstance( - self.parent.parent, nodes.Match + if ( + isinstance(self.parent, nodes.MatchCase) + and isinstance(self.parent.parent, nodes.Match) + and self.pattern is None ): yield self.parent.parent.subject |