[Python-checkins] r78721 - python/trunk/Lib/test/test_subprocess.py

florent.xicluna python-checkins at python.org
Sat Mar 6 10:54:14 CET 2010


Author: florent.xicluna
Date: Sat Mar 6 10:54:14 2010
New Revision: 78721
Log:
#2777: Apply same recipe on win32, i.e. do not inherit file handles.
Modified:
 python/trunk/Lib/test/test_subprocess.py
Modified: python/trunk/Lib/test/test_subprocess.py
==============================================================================
--- python/trunk/Lib/test/test_subprocess.py	(original)
+++ python/trunk/Lib/test/test_subprocess.py	Sat Mar 6 10:54:14 2010
@@ -769,21 +769,23 @@
 self.assertEqual(rc, 47)
 
 def test_send_signal(self):
- p = subprocess.Popen([sys.executable, "-c", "input()"])
+ # Do not inherit file handles from the parent.
+ # It should fix failure on some platforms.
+ p = subprocess.Popen([sys.executable, "-c", "input()"], close_fds=True)
 
 self.assertIs(p.poll(), None)
 p.send_signal(signal.SIGTERM)
 self.assertNotEqual(p.wait(), 0)
 
 def test_kill(self):
- p = subprocess.Popen([sys.executable, "-c", "input()"])
+ p = subprocess.Popen([sys.executable, "-c", "input()"], close_fds=True)
 
 self.assertIs(p.poll(), None)
 p.kill()
 self.assertNotEqual(p.wait(), 0)
 
 def test_terminate(self):
- p = subprocess.Popen([sys.executable, "-c", "input()"])
+ p = subprocess.Popen([sys.executable, "-c", "input()"], close_fds=True)
 
 self.assertIs(p.poll(), None)
 p.terminate()


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /