diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2024-08-07 19:44:18 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-07 19:44:18 (GMT) |
commit | f9637b4ba30bb0615cc7dd6e58211722f1437b00 (patch) | |
tree | bf58f28c0eec09ebfabcb08429522b90d594be50 /Lib/re | |
parent | d2e5be1f39bc3d48c7bc8c146c4bcadee266672a (diff) | |
download | cpython-f9637b4ba30bb0615cc7dd6e58211722f1437b00.zip cpython-f9637b4ba30bb0615cc7dd6e58211722f1437b00.tar.gz cpython-f9637b4ba30bb0615cc7dd6e58211722f1437b00.tar.bz2 |
Remove dead code in the RE parser (GH-122796)
Diffstat (limited to 'Lib/re')
-rw-r--r-- | Lib/re/_parser.py | 16 |
1 files changed, 0 insertions, 16 deletions
diff --git a/Lib/re/_parser.py b/Lib/re/_parser.py index f3c7793..0990255 100644 --- a/Lib/re/_parser.py +++ b/Lib/re/_parser.py @@ -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("|"): @@ -1038,14 +1030,6 @@ def parse_template(source, pattern): 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: |