mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
bpo-37804: Remove the deprecated method threading.Thread.isAlive() (GH-15225)
This commit is contained in:
parent
f9590edfea
commit
44046fe4fc
4 changed files with 6 additions and 12 deletions
|
@ -186,6 +186,10 @@ Removed
|
||||||
removed. They were deprecated since Python 3.7.
|
removed. They were deprecated since Python 3.7.
|
||||||
(Contributed by Victor Stinner in :issue:`37320`.)
|
(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
|
Porting to Python 3.9
|
||||||
=====================
|
=====================
|
||||||
|
|
|
@ -422,8 +422,6 @@ class ThreadTests(BaseTestCase):
|
||||||
t.setDaemon(True)
|
t.setDaemon(True)
|
||||||
t.getName()
|
t.getName()
|
||||||
t.setName("name")
|
t.setName("name")
|
||||||
with self.assertWarnsRegex(DeprecationWarning, 'use is_alive()'):
|
|
||||||
t.isAlive()
|
|
||||||
e = threading.Event()
|
e = threading.Event()
|
||||||
e.isSet()
|
e.isSet()
|
||||||
threading.activeCount()
|
threading.activeCount()
|
||||||
|
|
|
@ -1088,16 +1088,6 @@ class Thread:
|
||||||
self._wait_for_tstate_lock(False)
|
self._wait_for_tstate_lock(False)
|
||||||
return not self._is_stopped
|
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
|
@property
|
||||||
def daemon(self):
|
def daemon(self):
|
||||||
"""A boolean value indicating whether this thread is a daemon thread.
|
"""A boolean value indicating whether this thread is a daemon thread.
|
||||||
|
|
|
@ -0,0 +1,2 @@
|
||||||
|
Remove the deprecated method `threading.Thread.isAlive()`. Patch by Dong-hee
|
||||||
|
Na.
|
Loading…
Add table
Add a link
Reference in a new issue