diff options
author | Dong-hee Na <donghee.na92@gmail.com> | 2019-01-17 12:14:45 (GMT) |
---|---|---|
committer | Victor Stinner <vstinner@redhat.com> | 2019-01-17 12:14:45 (GMT) |
commit | 89669ffe10a9db6343f6ee42239e412c8ad96bde (patch) | |
tree | 5c525e474b70d00eaf8c22fa818a5ab44d446f62 /Lib/threading.py | |
parent | 97e12996f31f6ada4173e2cd4b6807c98ba379a4 (diff) | |
download | cpython-89669ffe10a9db6343f6ee42239e412c8ad96bde.zip cpython-89669ffe10a9db6343f6ee42239e412c8ad96bde.tar.gz cpython-89669ffe10a9db6343f6ee42239e412c8ad96bde.tar.bz2 |
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 bb41456..7bc8a85 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): |