From ec0087cea854fe26c5fbb7a7077963b6a2332dd0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartolom=C3=A9=20S=C3=A1nchez=20Salado?= Date: Sun, 17 Nov 2024 21:47:45 +0100 Subject: [PATCH] fix: Ruff rule RET506 (superfluous-else-raise) https://docs.astral.sh/ruff/rules/superfluous-else-raise/ --- pyproject.toml | 1 - src/ply/yacc.py | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index dfe05b939..38dfed58a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -135,7 +135,6 @@ ignore = [ "RET501", "RET503", "RET504", - "RET506", "RET507", "RUF005", "RUF012", diff --git a/src/ply/yacc.py b/src/ply/yacc.py index b9acb955b..ece139b59 100644 --- a/src/ply/yacc.py +++ b/src/ply/yacc.py @@ -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