Manual py3k backport: [svn r74155] Issue #6242: Fix deallocator of io.StringIO and io.BytesIO

This commit is contained in:
Antoine Pitrou 2009-10-24 11:59:41 +00:00
parent 5f029ce664
commit f98a267be3
3 changed files with 17 additions and 6 deletions

View file

@ -345,6 +345,13 @@ class MemoryTestMixin:
self.assertEqual(test1(), buf)
self.assertEqual(test2(), buf)
def test_instance_dict_leak(self):
# Test case for issue #6242.
# This will be caught by regrtest.py -R if this leak.
for _ in range(100):
memio = self.ioclass()
memio.foo = 1
class PyBytesIOTest(MemoryTestMixin, MemorySeekTestMixin, unittest.TestCase):