diff options
author | achhina <amanschhina@gmail.com> | 2023-12-11 20:45:08 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-11 20:45:08 (GMT) |
commit | a01022af23b27a9bfb4fadbcdb60b1ddf24a7220 (patch) | |
tree | 94379f595ca9d2b19effd282e2f8fc10ead2ae72 /Doc | |
parent | 0066ab5bc58a036b3f448cd6f9bbdd92120e39ba (diff) | |
download | cpython-a01022af23b27a9bfb4fadbcdb60b1ddf24a7220.zip cpython-a01022af23b27a9bfb4fadbcdb60b1ddf24a7220.tar.gz cpython-a01022af23b27a9bfb4fadbcdb60b1ddf24a7220.tar.bz2 |
GH-83162: Rename re.error for better clarity. (#101677)
Renamed re.error for clarity, and kept re.error for backward compatibility.
Updated idlelib files at TJR's request.
---------
Co-authored-by: Matthias Bussonnier <mbussonnier@ucmerced.edu>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/library/re.rst | 8 | ||||
-rw-r--r-- | Doc/whatsnew/3.13.rst | 5 |
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 ------- |