mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +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
|
@ -150,7 +150,7 @@ def _compile(code, pattern, flags):
|
|||
if lo > MAXCODE:
|
||||
raise error("looks too much behind")
|
||||
if lo != hi:
|
||||
raise error("look-behind requires fixed-width pattern")
|
||||
raise PatternError("look-behind requires fixed-width pattern")
|
||||
emit(lo) # look behind
|
||||
_compile(code, av[1], flags)
|
||||
emit(SUCCESS)
|
||||
|
@ -209,7 +209,7 @@ def _compile(code, pattern, flags):
|
|||
else:
|
||||
code[skipyes] = _len(code) - skipyes + 1
|
||||
else:
|
||||
raise error("internal: unsupported operand type %r" % (op,))
|
||||
raise PatternError(f"internal: unsupported operand type {op!r}")
|
||||
|
||||
def _compile_charset(charset, flags, code):
|
||||
# compile charset subprogram
|
||||
|
@ -235,7 +235,7 @@ def _compile_charset(charset, flags, code):
|
|||
else:
|
||||
emit(av)
|
||||
else:
|
||||
raise error("internal: unsupported set operator %r" % (op,))
|
||||
raise PatternError(f"internal: unsupported set operator {op!r}")
|
||||
emit(FAILURE)
|
||||
|
||||
def _optimize_charset(charset, iscased=None, fixup=None, fixes=None):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue