mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
bpo-35283: Add deprecation warning for Thread.isAlive (GH-11454)
Add a deprecated warning for the threading.Thread.isAlive() method.
This commit is contained in:
parent
97e12996f3
commit
89669ffe10
5 changed files with 17 additions and 4 deletions
|
@ -1091,7 +1091,15 @@ class Thread:
|
|||
self._wait_for_tstate_lock(False)
|
||||
return not self._is_stopped
|
||||
|
||||
isAlive = is_alive
|
||||
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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue