Skip to content

Commit 4fbe3b4

Browse files
committed
bpo-35283: Add the "isAlive" alias for _DummyThread
1 parent 062a57b commit 4fbe3b4

3 files changed

Lines changed: 5 additions & 0 deletions

File tree

Lib/test/test_threading.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,8 @@ def f(mutex):
173173
self.assertIsInstance(threading._active[tid], threading._DummyThread)
174174
#Issue 29376
175175
self.assertTrue(threading._active[tid].is_alive())
176+
#Issue 35283
177+
self.assertTrue(threading._active[tid].isAlive())
176178
self.assertRegex(repr(threading._active[tid]), '_DummyThread')
177179
del threading._active[tid]
178180

Lib/threading.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1197,6 +1197,8 @@ def is_alive(self):
11971197
assert not self._is_stopped and self._started.is_set()
11981198
return True
11991199

1200+
isAlive = is_alive
1201+
12001202
def join(self, timeout=None):
12011203
assert False, "cannot join a dummy thread"
12021204

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Add the "isAlive" alias for _DummyThread

0 commit comments

Comments
 (0)