[pywin32-checkins] pywin32/win32/test testall.py,1.9,1.10
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: Mark H. <mha...@us...> - 2008-12-11 07:01:17
|
Update of /cvsroot/pywin32/pywin32/win32/test In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv1249/win32/test Modified Files: testall.py Log Message: fix subprocess usage Index: testall.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/test/testall.py,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** testall.py 6 Dec 2008 00:46:46 -0000 1.9 --- testall.py 11 Dec 2008 07:01:12 -0000 1.10 *************** *** 26,35 **** self.argv = argv def __call__(self): ! # subprocess failed in strange ways for me?? ! fin, fout, ferr = os.popen3(" ".join(self.argv)) ! fin.close() ! output = fout.read() + ferr.read() ! fout.close() ! rc = ferr.close() if rc: base = os.path.basename(self.argv[1]) --- 26,43 ---- self.argv = argv def __call__(self): ! try: ! import subprocess ! p = subprocess.Popen(self.argv, ! stdout=subprocess.PIPE, ! stderr=subprocess.STDOUT) ! output, _ = p.communicate() ! rc = p.returncode ! except ImportError: ! # py2.3? ! fin, fout, ferr = os.popen3(" ".join(self.argv)) ! fin.close() ! output = fout.read() + ferr.read() ! fout.close() ! rc = ferr.close() if rc: base = os.path.basename(self.argv[1]) |