diff --git a/Doc/whatsnew/3.9.rst b/Doc/whatsnew/3.9.rst index 61d9e745e87ccfa..f09e09c2b90560f 100644 --- a/Doc/whatsnew/3.9.rst +++ b/Doc/whatsnew/3.9.rst @@ -186,6 +186,10 @@ Removed removed. They were deprecated since Python 3.7. (Contributed by Victor Stinner in :issue:`37320`.) +* The :meth:`~threading.Thread.isAlive()` method of :class:`threading.Thread` + has been removed. It was deprecated since Python 3.8. + Use :meth:`~threading.Thread.is_alive()` instead. + (Contributed by Dong-hee Na in :issue:`37804`.) Porting to Python 3.9 ===================== diff --git a/Lib/test/test_threading.py b/Lib/test/test_threading.py index 1466d25e948283d..7c16974c1630a7e 100644 --- a/Lib/test/test_threading.py +++ b/Lib/test/test_threading.py @@ -422,8 +422,6 @@ def test_old_threading_api(self): t.setDaemon(True) t.getName() t.setName("name") - with self.assertWarnsRegex(DeprecationWarning, 'use is_alive()'): - t.isAlive() e = threading.Event() e.isSet() threading.activeCount() diff --git a/Lib/threading.py b/Lib/threading.py index cec9cdb8e6985fc..32a3d7c3033621f 100644 --- a/Lib/threading.py +++ b/Lib/threading.py @@ -1088,16 +1088,6 @@ def is_alive(self): self._wait_for_tstate_lock(False) return not self._is_stopped - def isAlive(self): - """Return whether the thread is alive. - - This method is deprecated, use is_alive() instead. - """ - import warnings - warnings.warn('isAlive() is deprecated, use is_alive() instead', - DeprecationWarning, stacklevel=2) - return self.is_alive() - @property def daemon(self): """A boolean value indicating whether this thread is a daemon thread. diff --git a/Misc/NEWS.d/next/Library/2019-08-12-23-07-47.bpo-37804.Ene6L-.rst b/Misc/NEWS.d/next/Library/2019-08-12-23-07-47.bpo-37804.Ene6L-.rst new file mode 100644 index 000000000000000..ebbcb5aa7788f17 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2019-08-12-23-07-47.bpo-37804.Ene6L-.rst @@ -0,0 +1,2 @@ +Remove the deprecated method `threading.Thread.isAlive()`. Patch by Dong-hee +Na.