diff options
author | Dong-hee Na <donghee.na92@gmail.com> | 2019-01-17 21:14:45 +0900 |
---|---|---|
committer | Victor Stinner <vstinner@redhat.com> | 2019-01-17 13:14:45 +0100 |
commit | 89669ffe10a9db6343f6ee42239e412c8ad96bde (patch) | |
tree | 5c525e474b70d00eaf8c22fa818a5ab44d446f62 /Lib/threading.py | |
parent | Fixes typo in asyncio.queue doc (GH-11581) (diff) | |
download | cpython-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.py | 10 |
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): |