diff options
author | Gregory P. Smith <greg@krypto.org> | 2022-06-17 08:19:44 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-17 08:19:44 (GMT) |
commit | 4beee0c7b0c2cc78a893dde88fd8e34099dcf877 (patch) | |
tree | e3fa8fb0d8260f7c3d16d795c29580386868a5a6 /Lib/test/test_re.py | |
parent | 538f28921f67e36617272faa662375d305d9284c (diff) | |
download | cpython-4beee0c7b0c2cc78a893dde88fd8e34099dcf877.zip cpython-4beee0c7b0c2cc78a893dde88fd8e34099dcf877.tar.gz cpython-4beee0c7b0c2cc78a893dde88fd8e34099dcf877.tar.bz2 |
gh-91404: Revert "bpo-23689: re module, fix memory leak when a match is terminated by a signal or allocation failure (GH-32283) (#93882)
Revert "bpo-23689: re module, fix memory leak when a match is terminated by a signal or memory allocation failure (GH-32283)"
This reverts commit 6e3eee5c11b539e9aab39cff783acf57838c355a.
Manual fixups to increase the MAGIC number and to handle conflicts with
a couple of changes that landed after that.
Thanks for reviews by Ma Lin and Serhiy Storchaka.
Diffstat (limited to 'Lib/test/test_re.py')
-rw-r--r-- | Lib/test/test_re.py | 28 |
1 files changed, 2 insertions, 26 deletions
diff --git a/Lib/test/test_re.py b/Lib/test/test_re.py index 3752d73..9f734d4 100644 --- a/Lib/test/test_re.py +++ b/Lib/test/test_re.py @@ -1765,12 +1765,9 @@ class ReTests(unittest.TestCase): long_overflow = 2**128 self.assertRaises(TypeError, re.finditer, "a", {}) with self.assertRaises(OverflowError): - _sre.compile("abc", 0, [long_overflow], 0, {}, (), 0) + _sre.compile("abc", 0, [long_overflow], 0, {}, ()) with self.assertRaises(TypeError): - _sre.compile({}, 0, [], 0, [], [], 0) - with self.assertRaises(RuntimeError): - # invalid repeat_count -1 - _sre.compile("abc", 0, [1], 0, {}, (), -1) + _sre.compile({}, 0, [], 0, [], []) def test_search_dot_unicode(self): self.assertTrue(re.search("123.*-", '123abc-')) @@ -2509,27 +2506,6 @@ POSSESSIVE_REPEAT 0 1 14. SUCCESS ''') - def test_repeat_index(self): - self.assertEqual(get_debug_out(r'(?:ab)*?(?:cd)*'), '''\ -MIN_REPEAT 0 MAXREPEAT - LITERAL 97 - LITERAL 98 -MAX_REPEAT 0 MAXREPEAT - LITERAL 99 - LITERAL 100 - - 0. INFO 4 0b0 0 MAXREPEAT (to 5) - 5: REPEAT 8 0 MAXREPEAT 0 (to 14) -10. LITERAL 0x61 ('a') -12. LITERAL 0x62 ('b') -14: MIN_UNTIL -15. REPEAT 8 0 MAXREPEAT 1 (to 24) -20. LITERAL 0x63 ('c') -22. LITERAL 0x64 ('d') -24: MAX_UNTIL -25. SUCCESS -''') - class PatternReprTests(unittest.TestCase): def check(self, pattern, expected): |