summaryrefslogtreecommitdiffstats
path: root/Lib/idlelib
diff options
context:
space:
mode:
authorachhina <amanschhina@gmail.com>2023-12-11 20:45:08 (GMT)
committerGitHub <noreply@github.com>2023-12-11 20:45:08 (GMT)
commita01022af23b27a9bfb4fadbcdb60b1ddf24a7220 (patch)
tree94379f595ca9d2b19effd282e2f8fc10ead2ae72 /Lib/idlelib
parent0066ab5bc58a036b3f448cd6f9bbdd92120e39ba (diff)
downloadcpython-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 'Lib/idlelib')
-rw-r--r--Lib/idlelib/replace.py2
-rw-r--r--Lib/idlelib/searchengine.py2
2 files changed, 2 insertions, 2 deletions
diff --git a/Lib/idlelib/replace.py b/Lib/idlelib/replace.py
index a29ca59..7997f24 100644
--- a/Lib/idlelib/replace.py
+++ b/Lib/idlelib/replace.py
@@ -120,7 +120,7 @@ class ReplaceDialog(SearchDialogBase):
if self.engine.isre():
try:
new = m.expand(repl)
- except re.error:
+ except re.PatternError:
self.engine.report_error(repl, 'Invalid Replace Expression')
new = None
else:
diff --git a/Lib/idlelib/searchengine.py b/Lib/idlelib/searchengine.py
index 0684142..ceb38cf 100644
--- a/Lib/idlelib/searchengine.py
+++ b/Lib/idlelib/searchengine.py
@@ -84,7 +84,7 @@ class SearchEngine:
flags = flags | re.IGNORECASE
try:
prog = re.compile(pat, flags)
- except re.error as e:
+ except re.PatternError as e:
self.report_error(pat, e.msg, e.pos)
return None
return prog