summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_threading.py
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2008-09-06 23:00:03 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2008-09-06 23:00:03 (GMT)
commit5fe291f8175fde8cd5c55dd0d11486ddf82ef6b8 (patch)
tree58481fdd59d47e6b329d79599ea304985f359c2c /Lib/test/test_threading.py
parent0a608fdaac5b4422b9ade6ec7b44182902f2f9ce (diff)
downloadcpython-5fe291f8175fde8cd5c55dd0d11486ddf82ef6b8.zip
cpython-5fe291f8175fde8cd5c55dd0d11486ddf82ef6b8.tar.gz
cpython-5fe291f8175fde8cd5c55dd0d11486ddf82ef6b8.tar.bz2
Issue #874900: fix behaviour of threading module after a fork.
Reviewed by Gregory P. Smith.
Diffstat (limited to 'Lib/test/test_threading.py')
-rw-r--r--Lib/test/test_threading.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/Lib/test/test_threading.py b/Lib/test/test_threading.py
index 775e312..a7f2322 100644
--- a/Lib/test/test_threading.py
+++ b/Lib/test/test_threading.py
@@ -347,6 +347,9 @@ class ThreadJoinOnShutdown(unittest.TestCase):
def joiningfunc(mainthread):
mainthread.join()
print('end of thread')
+ # stdout is fully buffered because not a tty, we have to flush
+ # before exit.
+ sys.stdout.flush()
\n""" + script
import subprocess
@@ -388,8 +391,7 @@ class ThreadJoinOnShutdown(unittest.TestCase):
"""
self._run_and_join(script)
- # XXX This test hangs!
- def Xtest_3_join_in_forked_from_thread(self):
+ def test_3_join_in_forked_from_thread(self):
# Like the test above, but fork() was called from a worker thread
# In the forked process, the main Thread object must be marked as stopped.
import os