From 0390b24d92f3cafedfbdfcd65346b20f3add3c05 Mon Sep 17 00:00:00 2001 From: Dong-hee Na Date: Mon, 7 Jan 2019 17:17:23 +0900 Subject: [PATCH] bpo-35283: Add a deprecated warning for the threading.Thread.isAlive --- Lib/threading.py | 10 +++++++++- .../Library/2019-01-07-17-17-16.bpo-35283.WClosC.rst | 2 ++ 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 Misc/NEWS.d/next/Library/2019-01-07-17-17-16.bpo-35283.WClosC.rst diff --git a/Lib/threading.py b/Lib/threading.py index bb41456fb1410c..5fc7cbe239cbbb 100644 --- a/Lib/threading.py +++ b/Lib/threading.py @@ -1091,7 +1091,15 @@ def is_alive(self): self._wait_for_tstate_lock(False) return not self._is_stopped - isAlive = is_alive + def isAlive(self): + """Return whether the thread is alive. + + This instance method is deprecated, use is_alive() instead. + """ + import warnings + warnings.warn('isAlive() is deprecated, use is_alive() instead', + PendingDeprecationWarning, stacklevel=2) + return self.is_alive() @property def daemon(self): diff --git a/Misc/NEWS.d/next/Library/2019-01-07-17-17-16.bpo-35283.WClosC.rst b/Misc/NEWS.d/next/Library/2019-01-07-17-17-16.bpo-35283.WClosC.rst new file mode 100644 index 00000000000000..6c9c06eff2b5f9 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2019-01-07-17-17-16.bpo-35283.WClosC.rst @@ -0,0 +1,2 @@ +Add a deprecated warning for the threading.Thread.isAlive. +Patch by Dong-hee Na.