Skip to content

Commit b7ea179

Browse files
author
Anselm Kruis
committed
StacklessTestCase: make the pickling support less obstructive
Strip eventually unpickleable attributes as late a possible using a cleanup function.
1 parent 0adf793 commit b7ea179

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

stackless_testsuite/util.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,11 +262,11 @@ def __strip_attributes(self):
262262
del self.__dict__[k]
263263
if sys.hexversion >= 0x3040000:
264264
def _addSkip(self, result, test_case, reason):
265-
self.__strip_attributes()
265+
self.addCleanup(self.__strip_attributes)
266266
super(StacklessTestCase, self)._addSkip(result, test_case, reason)
267267
else:
268268
def _addSkip(self, result, reason):
269-
self.__strip_attributes()
269+
self.addCleanup(self.__strip_attributes)
270270
super(StacklessTestCase, self)._addSkip(result, reason)
271271

272272
_tc = StacklessTestCase(methodName='run')

0 commit comments

Comments
 (0)