mirror of
https://github.com/python/cpython.git
synced 2025-08-30 05:35:08 +00:00
merge 3.2 (#14212)
This commit is contained in:
commit
33d21a24fa
4 changed files with 61 additions and 26 deletions
|
@ -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')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue