Skip to content

Commit

Permalink
馃懝 Feed the hobgoblins (delint).
Browse files Browse the repository at this point in the history
  • Loading branch information
jaraco committed Mar 31, 2024
1 parent 57dca31 commit 8e5842c
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions inflect/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2122,8 +2122,8 @@ def checkpat(self, pattern: Optional[Word]) -> None:
return
try:
re.match(pattern, "")
except re.error:
raise BadUserDefinedPatternError(pattern)
except re.error as err:
raise BadUserDefinedPatternError(pattern) from err

def checkpatplural(self, pattern: Optional[Word]) -> None:
"""
Expand Down Expand Up @@ -2192,8 +2192,8 @@ def num(
if count is not None:
try:
self.persistent_count = int(count)
except ValueError:
raise BadNumValueError
except ValueError as err:
raise BadNumValueError from err
if (show is None) or show:
return str(count)
else:
Expand Down Expand Up @@ -3003,7 +3003,7 @@ def _find_pivot(words, candidates):
try:
return next(pivots)
except StopIteration:
raise ValueError("No pivot found")
raise ValueError("No pivot found") from None

def _pl_special_verb( # noqa: C901
self, word: str, count: Optional[Union[str, int]] = None
Expand Down Expand Up @@ -3168,8 +3168,8 @@ def _sinoun( # noqa: C901
gender = self.thegender
elif gender not in singular_pronoun_genders:
raise BadGenderError
except (TypeError, IndexError):
raise BadGenderError
except (TypeError, IndexError) as err:
raise BadGenderError from err

# HANDLE USER-DEFINED NOUNS

Expand Down

0 comments on commit 8e5842c

Please sign in to comment.