8000 bpo-37804: Remove the deprecated method threading.Thread.isAlive() · python/cpython@ff1f8a4 · GitHub
[go: up one dir, main page]

Skip to content

Commit ff1f8a4

Browse files
committed
bpo-37804: Remove the deprecated method threading.Thread.isAlive()
1 parent f9590ed commit ff1f8a4

File tree

4 files changed

+6
-12
lines changed

4 files changed

+6
-12
lines changed

Doc/whatsnew/3.9.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,10 @@ Removed
186186
removed. They were deprecated since Python 3.7.
187187
(Contributed by Victor Stinner in :issue:`37320`.)
188188

189+
* The :meth:`~threading.Thread.isAlive()` method of :class:`threading.Thread`
190+
has been removed. It was deprecated since Python 3.8.
191+
Use :meth:`~threading.Thread.is_alive()` instead.
192+
(Contributed by Dong-hee Na in :issue:`37804`.)
189193

190194
Porting to Python 3.9
191195
=====================

Lib/test/test_threading.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -422,8 +422,6 @@ def test_old_threading_api(self):
422422
t.setDaemon(True)
423423
t.getName()
424424
t.setName("name")
425-
with self.assertWarnsRegex(DeprecationWarning, 'use is_alive()'):
426-
t.isAlive()
427425
e = threading.Event()
428426
e.isSet()
429427
threading.activeCount()

Lib/threading.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1088,16 +1088,6 @@ def is_alive(self):
10881088
self._wait_for_tstate_lock(False)
10891089
return not self._is_stopped
10901090

1091-
def isAlive(self):
1092-
"""Return whether the thread is alive.
1093-
1094-
This method is deprecated, use is_alive() instead.
1095-
"""
1096-
import warnings
1097-
warnings.warn('isAlive() is deprecated, use is_alive() instead',
1098-
DeprecationWarning, stacklevel=2)
1099-
return self.is_alive()
1100-
11011091
@property
11021092
def daemon(self):
11031093
"""A boolean value indicating whether this thread is a daemon thread.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Remove the deprecated method `threading.Thread.isAlive()`. Patch by Dong-hee
2+
Na.

0 commit comments

Comments
 (0)
0