diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2010-09-19 23:28:30 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2010-09-19 23:28:30 (GMT) |
commit | 7c08744f523e0c054156ea06eb97d09a8caae314 (patch) | |
tree | 31aba0cb915a1759f431e0ea83e21b64e86c5928 /Lib/test/test_threading.py | |
parent | fedd481596799419c0019a37ae1b9319abeacdc8 (diff) | |
download | cpython-7c08744f523e0c054156ea06eb97d09a8caae314.zip cpython-7c08744f523e0c054156ea06eb97d09a8caae314.tar.gz cpython-7c08744f523e0c054156ea06eb97d09a8caae314.tar.bz2 |
Make error more explicit in test_finalize_with_trace
Diffstat (limited to 'Lib/test/test_threading.py')
-rw-r--r-- | Lib/test/test_threading.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/Lib/test/test_threading.py b/Lib/test/test_threading.py index 39c5a17..19ba730 100644 --- a/Lib/test/test_threading.py +++ b/Lib/test/test_threading.py @@ -304,7 +304,7 @@ class ThreadTests(BaseTestCase): # Issue1733757 # Avoid a deadlock when sys.settrace steps into threading._shutdown import subprocess - rc = subprocess.call([sys.executable, "-c", """if 1: + p = subprocess.Popen([sys.executable, "-c", """if 1: import sys, threading # A deadlock-killer, to prevent the @@ -324,9 +324,14 @@ class ThreadTests(BaseTestCase): return func sys.settrace(func) - """]) + """], + stdout=subprocess.PIPE, + stderr=subprocess.PIPE) + stdout, stderr = p.communicate() + rc = p.returncode self.assertFalse(rc == 2, "interpreted was blocked") - self.assertTrue(rc == 0, "Unexpected error") + self.assertTrue(rc == 0, + "Unexpected error: " + ascii(stderr)) def test_join_nondaemon_on_shutdown(self): # Issue 1722344 |