summaryrefslogtreecommitdiffstats
path: root/Lib/threading.py
diff options
context:
space:
mode:
authorTim Peters <tim@python.org>2013-09-09 23:48:24 (GMT)
committerTim Peters <tim@python.org>2013-09-09 23:48:24 (GMT)
commit72460fa68ba98f5aa94cdc842070884403c0fc73 (patch)
treec35fa089da52dce5cb1f10c373ce19b9b90e76c8 /Lib/threading.py
parentb5e9ac9ec63f2d437515edd2cbce31c5774e9dbd (diff)
downloadcpython-72460fa68ba98f5aa94cdc842070884403c0fc73.zip
cpython-72460fa68ba98f5aa94cdc842070884403c0fc73.tar.gz
cpython-72460fa68ba98f5aa94cdc842070884403c0fc73.tar.bz2
Get "stopped" back into repr(Thread) when appropriate.
Due to recent changes, a Thread doesn't know that it's over before someone calls .join() or .is_alive(). That meant repr(Thread) continued to include "started" (and not "stopped") before one of those methods was called, even if hours passed since the thread ended. Repaired that.
Diffstat (limited to 'Lib/threading.py')
-rw-r--r--Lib/threading.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/Lib/threading.py b/Lib/threading.py
index 1ad22a4..26d1018 100644
--- a/Lib/threading.py
+++ b/Lib/threading.py
@@ -574,6 +574,7 @@ class Thread:
status = "initial"
if self._started.is_set():
status = "started"
+ self.is_alive() # easy way to get ._is_stopped set when appropriate
if self._is_stopped:
status = "stopped"
if self._daemonic: