Skip to content

Commit

Permalink
[PY313] Handle alias for re.PatternError
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobtylerwalls committed Aug 6, 2024
1 parent b98e649 commit f169684
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pylint/extensions/docparams.py
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,9 @@ def visit_raise(self, node: nodes.Raise) -> None:
for found_exc in found_excs_class_names:
if found_exc == expected.name:
break
if found_exc == "error" and expected.name == "PatternError":
# Python 3.13: re.error aliases re.PatternError

Check notice on line 325 in pylint/extensions/docparams.py

View workflow job for this annotation

GitHub Actions / pylint

C0401

Wrong spelling of a word 'PatternError' in a comment:
break
if any(found_exc == ancestor.name for ancestor in expected.ancestors()):
break
else:
Expand Down Expand Up @@ -653,7 +656,7 @@ def _add_raise_message(
"""Adds a message on :param:`node` for the missing exception type.
:param missing_exceptions: A list of missing exception types.
:param node: The node show the message on.
:param node: The node to show the message on.
"""
if node.is_abstract():
try:
Expand Down

0 comments on commit f169684

Please sign in to comment.