summaryrefslogtreecommitdiffstats
path: root/Lib/re
diff options
context:
space:
mode:
authorSKO <41810398+uyw4687@users.noreply.github.com>2023-08-16 07:43:45 (GMT)
committerGitHub <noreply@github.com>2023-08-16 07:43:45 (GMT)
commitabd9cc52d94b8e2835322b62c29f09bb0e6fcfe9 (patch)
tree252a5f9d86fa4746cf7615ab7e6f16ceb12dede5 /Lib/re
parenta86df298df5b02e2d69ea6879e9ed10a7adb85d0 (diff)
downloadcpython-abd9cc52d94b8e2835322b62c29f09bb0e6fcfe9.zip
cpython-abd9cc52d94b8e2835322b62c29f09bb0e6fcfe9.tar.gz
cpython-abd9cc52d94b8e2835322b62c29f09bb0e6fcfe9.tar.bz2
gh-100061: Proper fix of the bug in the matching of possessive quantifiers (GH-102612)
Restore the global Input Stream pointer after trying to match a sub-pattern. Co-authored-by: Ma Lin <animalize@users.noreply.github.com>
Diffstat (limited to 'Lib/re')
-rw-r--r--Lib/re/_compiler.py7
1 files changed, 0 insertions, 7 deletions
diff --git a/Lib/re/_compiler.py b/Lib/re/_compiler.py
index f5fd160..d0a4c55 100644
--- a/Lib/re/_compiler.py
+++ b/Lib/re/_compiler.py
@@ -100,13 +100,6 @@ def _compile(code, pattern, flags):
emit(ANY_ALL)
else:
emit(ANY)
- elif op is POSSESSIVE_REPEAT:
- # gh-106052: Possessive quantifiers do not work when the
- # subpattern contains backtracking, i.e. "(?:ab?c)*+".
- # Implement it as equivalent greedy qualifier in atomic group.
- p = [(MAX_REPEAT, av)]
- p = [(ATOMIC_GROUP, p)]
- _compile(code, p, flags)
elif op in REPEATING_CODES:
if _simple(av[2]):
emit(REPEATING_CODES[op][2])