mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
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>
This commit is contained in:
parent
0066ab5bc5
commit
a01022af23
10 changed files with 53 additions and 34 deletions
|
@ -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:
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue