This commit is contained in:
Benjamin Peterson 2012-03-07 14:59:13 -06:00
commit 33d21a24fa
4 changed files with 61 additions and 26 deletions

View file

@ -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')