diff options
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 71135cc2e0..713ea9cd33 100644 --- a/Lib/test/test_threading.py +++ b/Lib/test/test_threading.py @@ -279,7 +279,7 @@ class ThreadTests(unittest.TestCase): # 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 @@ -299,9 +299,14 @@ class ThreadTests(unittest.TestCase): 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 |