Commit 7810de8d authored by Jim Fulton's avatar Jim Fulton

Python 2.6 and 2.7 ABCs have a bug that causes memory leaks when

classes created on the fly are used with them. Unfortunately, UserList
and thus PersistentList have ABCs.  :(  So changed an in-test-created
class to a glbal to avoid a testing memory leak so as not to hide real
memory leaks.
parent 6c350c9b
...@@ -20,6 +20,14 @@ l0 = [] ...@@ -20,6 +20,14 @@ l0 = []
l1 = [0] l1 = [0]
l2 = [0, 1] l2 = [0, 1]
class OtherList:
def __init__(self, initlist):
self.__data = initlist
def __len__(self):
return len(self.__data)
def __getitem__(self, i):
return self.__data[i]
class TestPList(unittest.TestCase): class TestPList(unittest.TestCase):
def _getTargetClass(self): def _getTargetClass(self):
...@@ -49,13 +57,6 @@ class TestPList(unittest.TestCase): ...@@ -49,13 +57,6 @@ class TestPList(unittest.TestCase):
uu2 = pl(u2) uu2 = pl(u2)
v = pl(tuple(u)) v = pl(tuple(u))
class OtherList:
def __init__(self, initlist):
self.__data = initlist
def __len__(self):
return len(self.__data)
def __getitem__(self, i):
return self.__data[i]
v0 = pl(OtherList(u0)) v0 = pl(OtherList(u0))
vv = pl("this is also a sequence") vv = pl("this is also a sequence")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment