issue #477: Py2.4: enumerate() may return stopped threads.

This commit is contained in:
David Wilson 2019-01-23 12:44:08 +00:00
parent 51a07dce70
commit 4388e794ce
1 changed files with 2 additions and 1 deletions

View File

@ -302,7 +302,8 @@ class TestCase(unittest2.TestCase):
counts = {}
for thread in threading.enumerate():
name = thread.getName()
assert name in self.ALLOWED_THREADS, \
# Python 2.4: enumerate() may return stopped threads.
assert (not thread.isAlive()) or name in self.ALLOWED_THREADS, \
'Found thread %r still running after tests.' % (name,)
counts[name] = counts.get(name, 0) + 1