Skip to content

Commit

Permalink
Merge pull request #897 from bartsanchez/bart/fix-ruff-rule-RET506
Browse files Browse the repository at this point in the history
fix: Ruff rule RET506 (superfluous-else-raise)
  • Loading branch information
boriel authored Nov 17, 2024
2 parents d704b44 + ec0087c commit 78ce6a3
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@ ignore = [
"RET501",
"RET503",
"RET504",
"RET506",
"RET507",
"RUF005",
"RUF012",
Expand Down
3 changes: 1 addition & 2 deletions src/ply/yacc.py
Original file line number Diff line number Diff line change
Expand Up @@ -893,8 +893,7 @@ def add_production(self, prodname, syms, func=None, file="", line=0):
prodprec = self.Precedence.get(precname)
if not prodprec:
raise GrammarError("%s:%d: Nothing known about the precedence of %r" % (file, line, precname))
else:
self.UsedPrecedence.add(precname)
self.UsedPrecedence.add(precname)
del syms[-2:] # Drop %prec from the rule
else:
# If no %prec, precedence is determined by the rightmost terminal symbol
Expand Down

0 comments on commit 78ce6a3

Please sign in to comment.