diff options
-rw-r--r-- | Doc/whatsnew/3.9.rst | 4 | ||||
-rw-r--r-- | Lib/test/test_threading.py | 2 | ||||
-rw-r--r-- | Lib/threading.py | 10 | ||||
-rw-r--r-- | Misc/NEWS.d/next/Library/2019-08-12-23-07-47.bpo-37804.Ene6L-.rst | 2 |
4 files changed, 6 insertions, 12 deletions
diff --git a/Doc/whatsnew/3.9.rst b/Doc/whatsnew/3.9.rst index 61d9e74..f09e09c 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 1466d25..7c16974 100644 --- a/Lib/test/test_threading.py +++ b/Lib/test/test_threading.py @@ -422,8 +422,6 @@ class ThreadTests(BaseTestCase): 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 cec9cdb..32a3d7c 100644 --- a/Lib/threading.py +++ b/Lib/threading.py @@ -1088,16 +1088,6 @@ class Thread: 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 0000000..ebbcb5a --- /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. |