summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_re.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_re.py')
-rw-r--r--Lib/test/test_re.py14
1 files changed, 13 insertions, 1 deletions
diff --git a/Lib/test/test_re.py b/Lib/test/test_re.py
index 0f39ead..4e18531 100644
--- a/Lib/test/test_re.py
+++ b/Lib/test/test_re.py
@@ -1,4 +1,5 @@
-from test.support import verbose, run_unittest
+from test.support import verbose, run_unittest, gc_collect
+import io
import re
from re import Scanner
import sys
@@ -16,6 +17,17 @@ import unittest
class ReTests(unittest.TestCase):
+ def test_keep_buffer(self):
+ # See bug 14212
+ b = bytearray(b'x')
+ it = re.finditer(b'a', b)
+ with self.assertRaises(BufferError):
+ b.extend(b'x'*400)
+ list(it)
+ del it
+ gc_collect()
+ b.extend(b'x'*400)
+
def test_weakref(self):
s = 'QabbbcR'
x = re.compile('ab+c')