From f1696842b996da74b8e2cd5e24c07c00bd0ba54f Mon Sep 17 00:00:00 2001 From: Jacob Walls Date: Mon, 5 Aug 2024 20:48:24 -0400 Subject: [PATCH] [PY313] Handle alias for re.PatternError --- pylint/extensions/docparams.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pylint/extensions/docparams.py b/pylint/extensions/docparams.py index 5d672131a24..b19560b7fb6 100644 --- a/pylint/extensions/docparams.py +++ b/pylint/extensions/docparams.py @@ -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 + break if any(found_exc == ancestor.name for ancestor in expected.ancestors()): break else: @@ -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: