summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/re.rst8
-rw-r--r--Doc/whatsnew/3.13.rst5
2 files changed, 11 insertions, 2 deletions
diff --git a/Doc/library/re.rst b/Doc/library/re.rst
index 251ec8c..302f722 100644
--- a/Doc/library/re.rst
+++ b/Doc/library/re.rst
@@ -1093,12 +1093,12 @@ Functions
Exceptions
^^^^^^^^^^
-.. exception:: error(msg, pattern=None, pos=None)
+.. exception:: PatternError(msg, pattern=None, pos=None)
Exception raised when a string passed to one of the functions here is not a
valid regular expression (for example, it might contain unmatched parentheses)
or when some other error occurs during compilation or matching. It is never an
- error if a string contains no match for a pattern. The error instance has
+ error if a string contains no match for a pattern. The ``PatternError`` instance has
the following additional attributes:
.. attribute:: msg
@@ -1124,6 +1124,10 @@ Exceptions
.. versionchanged:: 3.5
Added additional attributes.
+ .. versionchanged:: 3.13
+ ``PatternError`` was originally named ``error``; the latter is kept as an alias for
+ backward compatibility.
+
.. _re-objects:
Regular Expression Objects
diff --git a/Doc/whatsnew/3.13.rst b/Doc/whatsnew/3.13.rst
index 00f3968..d599ba9 100644
--- a/Doc/whatsnew/3.13.rst
+++ b/Doc/whatsnew/3.13.rst
@@ -298,6 +298,11 @@ pdb
command line option or :envvar:`PYTHONSAFEPATH` environment variable).
(Contributed by Tian Gao and Christian Walther in :gh:`111762`.)
+re
+--
+* Rename :exc:`!re.error` to :exc:`re.PatternError` for improved clarity.
+ :exc:`!re.error` is kept for backward compatibility.
+
sqlite3
-------