summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_re.py
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2012-03-07 20:59:13 (GMT)
committerBenjamin Peterson <benjamin@python.org>2012-03-07 20:59:13 (GMT)
commit33d21a24fa3da625e20eb4d543eb1f9f6392f96c (patch)
tree163cb398c8d0c335a740f3e6f8f07db636a8bcfd /Lib/test/test_re.py
parent2fa0cbc9ae6bb8d29b3c8c1e871192602666157a (diff)
parent1ae230aa1a0c7b51839c6d07eaaddfeef71be63b (diff)
downloadcpython-33d21a24fa3da625e20eb4d543eb1f9f6392f96c.zip
cpython-33d21a24fa3da625e20eb4d543eb1f9f6392f96c.tar.gz
cpython-33d21a24fa3da625e20eb4d543eb1f9f6392f96c.tar.bz2
merge 3.2 (#14212)
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 0d5f617..34c4a5f 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')