mirror of
https://github.com/python/cpython.git
synced 2025-10-04 22:20:46 +00:00
bpo-29376: Fix assertion error in threading._DummyThread.is_alive() (GH-329)
This commit is contained in:
parent
b7fb1e25c8
commit
8400ae209b
3 changed files with 9 additions and 0 deletions
|
@ -170,6 +170,9 @@ class ThreadTests(BaseTestCase):
|
||||||
mutex.acquire()
|
mutex.acquire()
|
||||||
self.assertIn(tid, threading._active)
|
self.assertIn(tid, threading._active)
|
||||||
self.assertIsInstance(threading._active[tid], threading._DummyThread)
|
self.assertIsInstance(threading._active[tid], threading._DummyThread)
|
||||||
|
#Issue 29376
|
||||||
|
self.assertTrue(threading._active[tid].is_alive())
|
||||||
|
self.assertRegex(repr(threading._active[tid]), '_DummyThread')
|
||||||
del threading._active[tid]
|
del threading._active[tid]
|
||||||
|
|
||||||
# PyThreadState_SetAsyncExc() is a CPython-only gimmick, not (currently)
|
# PyThreadState_SetAsyncExc() is a CPython-only gimmick, not (currently)
|
||||||
|
|
|
@ -1215,6 +1215,10 @@ class _DummyThread(Thread):
|
||||||
def _stop(self):
|
def _stop(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
def is_alive(self):
|
||||||
|
assert not self._is_stopped and self._started.is_set()
|
||||||
|
return True
|
||||||
|
|
||||||
def join(self, timeout=None):
|
def join(self, timeout=None):
|
||||||
assert False, "cannot join a dummy thread"
|
assert False, "cannot join a dummy thread"
|
||||||
|
|
||||||
|
|
|
@ -32,6 +32,8 @@ Extension Modules
|
||||||
Library
|
Library
|
||||||
-------
|
-------
|
||||||
|
|
||||||
|
- bpo-29376: Fix assertion error in threading._DummyThread.is_alive().
|
||||||
|
|
||||||
- bpo-29110: Fix file object leak in aifc.open() when file is given as a
|
- bpo-29110: Fix file object leak in aifc.open() when file is given as a
|
||||||
filesystem path and is not in valid AIFF format. Patch by Anthony Zhang.
|
filesystem path and is not in valid AIFF format. Patch by Anthony Zhang.
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue