Skip to content

Commit

Permalink
bpo-37804: Remove the deprecated method threading.Thread.isAlive() (p…
Browse files Browse the repository at this point in the history
  • Loading branch information
corona10 authored and DinoV committed Jan 14, 2020
1 parent e5d5ec6 commit 10efdfe
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 12 deletions.
4 changes: 4 additions & 0 deletions Doc/whatsnew/3.9.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
=====================
Expand Down
2 changes: 0 additions & 2 deletions Lib/test/test_threading.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
10 changes: 0 additions & 10 deletions Lib/threading.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Remove the deprecated method `threading.Thread.isAlive()`. Patch by Dong-hee
Na.

0 comments on commit 10efdfe

Please sign in to comment.