Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
zrr1999 committed Nov 30, 2023
1 parent f8a9b80 commit 2377202
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libcst/_nodes/statement.py
Original file line number Diff line number Diff line change
Expand Up @@ -3239,7 +3239,7 @@ class MatchMapping(MatchPattern):
rpar: Sequence[RightParen] = ()

def _validate(self) -> None:
if isinstance(self.trailing_comma, Comma) and self.rest is not None:
if isinstance(self.trailing_comma, Comma) and self.rest is None:
raise CSTValidationError("Cannot have a trailing comma without **rest")
super(MatchMapping, self)._validate()

Expand Down

0 comments on commit 2377202

Please sign in to comment.