Skip to content

Commit

Permalink
Remove dead code in the RE parser (pythonGH-122796)
Browse files Browse the repository at this point in the history
  • Loading branch information
serhiy-storchaka authored and blhsing committed Aug 22, 2024
1 parent 9c72643 commit c2db627
Showing 1 changed file with 0 additions and 16 deletions.
16 changes: 0 additions & 16 deletions Lib/re/_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -807,14 +807,6 @@ def _parse(source, state, verbose, nested, first=False):
state.grouprefpos[condgroup] = (
source.tell() - len(condname) - 1
)
if not (condname.isdecimal() and condname.isascii()):
import warnings
warnings.warn(
"bad character in group name %s at position %d" %
(repr(condname) if source.istext else ascii(condname),
source.tell() - len(condname) - 1),
DeprecationWarning, stacklevel=nested + 6
)
state.checklookbehindgroup(condgroup, source)
item_yes = _parse(source, state, verbose, nested + 1)
if source.match("|"):
Expand Down Expand Up @@ -1038,14 +1030,6 @@ def addgroup(index, pos):
if index >= MAXGROUPS:
raise s.error("invalid group reference %d" % index,
len(name) + 1)
if not (name.isdecimal() and name.isascii()):
import warnings
warnings.warn(
"bad character in group name %s at position %d" %
(repr(name) if s.istext else ascii(name),
s.tell() - len(name) - 1),
DeprecationWarning, stacklevel=5
)
addgroup(index, len(name) + 1)
elif c == "0":
if s.next in OCTDIGITS:
Expand Down

0 comments on commit c2db627

Please sign in to comment.