bpo-37804: Remove the deprecated method threading.Thread.isAlive() (GH-15225)
authorDong-hee Na <donghee.na92@gmail.com>
Mon, 12 Aug 2019 17:41:08 +0000 (02:41 +0900)
committerVictor Stinner <vstinner@redhat.com>
Mon, 12 Aug 2019 17:41:08 +0000 (19:41 +0200)
Doc/whatsnew/3.9.rst
Lib/test/test_threading.py
Lib/threading.py
Misc/NEWS.d/next/Library/2019-08-12-23-07-47.bpo-37804.Ene6L-.rst [new file with mode: 0644]

index 61d9e745e87ccfa0b853e8d6de2cf23eb7669cff..f09e09c2b90560ff874519eb092d24faf44fe37e 100644 (file)
@@ -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
 =====================
index 1466d25e948283d4a257595008126cfd736147cc..7c16974c1630a7eaf275b2b0b07887640b4d53a2 100644 (file)
@@ -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()
index cec9cdb8e6985fc505e1900131cb28e02ed35399..32a3d7c3033621f0604cfea91726e3d3a44f1748 100644 (file)
@@ -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 (file)
index 0000000..ebbcb5a
--- /dev/null
@@ -0,0 +1,2 @@
+Remove the deprecated method `threading.Thread.isAlive()`. Patch by Dong-hee
+Na.