aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDong-hee Na <donghee.na92@gmail.com>2019-01-17 21:14:45 +0900
committerVictor Stinner <vstinner@redhat.com>2019-01-17 13:14:45 +0100
commit89669ffe10a9db6343f6ee42239e412c8ad96bde (patch)
tree5c525e474b70d00eaf8c22fa818a5ab44d446f62 /Lib/threading.py
parentFixes typo in asyncio.queue doc (GH-11581) (diff)
downloadcpython-89669ffe10a9db6343f6ee42239e412c8ad96bde.tar.gz
cpython-89669ffe10a9db6343f6ee42239e412c8ad96bde.tar.bz2
cpython-89669ffe10a9db6343f6ee42239e412c8ad96bde.zip
bpo-35283: Add deprecation warning for Thread.isAlive (GH-11454)
Add a deprecated warning for the threading.Thread.isAlive() method.
Diffstat (limited to 'Lib/threading.py')
-rw-r--r--Lib/threading.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/Lib/threading.py b/Lib/threading.py
index bb41456fb14..7bc8a8573c7 100644
--- a/Lib/threading.py
+++ b/Lib/threading.py
@@ -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):