diff --git a/Lib/test/test_threading.py b/Lib/test/test_threading.py index 8160a5af006447..53aa79b48c2b54 100644 --- a/Lib/test/test_threading.py +++ b/Lib/test/test_threading.py @@ -173,6 +173,8 @@ def f(mutex): self.assertIsInstance(threading._active[tid], threading._DummyThread) #Issue 29376 self.assertTrue(threading._active[tid].is_alive()) + #Issue 35283 + self.assertTrue(threading._active[tid].isAlive()) self.assertRegex(repr(threading._active[tid]), '_DummyThread') del threading._active[tid] diff --git a/Lib/threading.py b/Lib/threading.py index bb41456fb1410c..a47f4acb49fc53 100644 --- a/Lib/threading.py +++ b/Lib/threading.py @@ -1197,6 +1197,8 @@ def is_alive(self): assert not self._is_stopped and self._started.is_set() return True + isAlive = is_alive + def join(self, timeout=None): assert False, "cannot join a dummy thread" diff --git a/Misc/NEWS.d/next/Library/2018-11-22-20-14-14.bpo-35283.OBqxuw.rst b/Misc/NEWS.d/next/Library/2018-11-22-20-14-14.bpo-35283.OBqxuw.rst new file mode 100644 index 00000000000000..f57b0ad85d540c --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-11-22-20-14-14.bpo-35283.OBqxuw.rst @@ -0,0 +1 @@ +Add the "isAlive" alias for _DummyThread