[Python-checkins] r84911 - python/branches/py3k/Lib/test/test_threading.py

antoine.pitrou python-checkins at python.org
Mon Sep 20 01:28:30 CEST 2010


Author: antoine.pitrou
Date: Mon Sep 20 01:28:30 2010
New Revision: 84911

Log:
Make error more explicit in test_finalize_with_trace



Modified:
   python/branches/py3k/Lib/test/test_threading.py

Modified: python/branches/py3k/Lib/test/test_threading.py
==============================================================================
--- python/branches/py3k/Lib/test/test_threading.py	(original)
+++ python/branches/py3k/Lib/test/test_threading.py	Mon Sep 20 01:28:30 2010
@@ -304,7 +304,7 @@
         # 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 @@
                 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


More information about the Python-checkins mailing list