[Python-checkins] CVS: python/dist/src/Lib popen2.py,1.12,1.13
Tim Peters
python-dev@python.org
Sat, 19 Aug 2000 22:57:39 -0700
Update of /cvsroot/python/python/dist/src/Lib
In directory slayer.i.sourceforge.net:/tmp/cvs-serv1320/python/dist/src/lib
Modified Files:
popen2.py
Log Message:
Changed the popen2.py _test function to use the "more" cmd when
os.name == "nt". This makes test_popen2 pass under Win98SE.
HOWEVER, the Win98 "more" invents a leading newline out
of thin air, and I'm not sure that the other Windows flavors
of "more" also do that.
So, somebody please try under other Windows flavors!
Index: popen2.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/popen2.py,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -r1.12 -r1.13
*** popen2.py 2000/07/10 14:28:25 1.12
--- popen2.py 2000/08/20 05:57:36 1.13
***************
*** 141,158 ****
def _test():
teststr = "abc\n"
print "testing popen2..."
! r, w = popen2('cat')
w.write(teststr)
w.close()
! assert r.read() == teststr
print "testing popen3..."
try:
! r, w, e = popen3(['cat'])
except:
! r, w, e = popen3('cat')
w.write(teststr)
w.close()
! assert r.read() == teststr
assert e.read() == ""
for inst in _active[:]:
--- 141,163 ----
def _test():
+ cmd = "cat"
teststr = "abc\n"
+ resultstr = teststr
+ if os.name == "nt":
+ cmd = "more"
+ resultstr = "\n" + resultstr
print "testing popen2..."
! r, w = popen2(cmd)
w.write(teststr)
w.close()
! assert r.read() == resultstr
print "testing popen3..."
try:
! r, w, e = popen3([cmd])
except:
! r, w, e = popen3(cmd)
w.write(teststr)
w.close()
! assert r.read() == resultstr
assert e.read() == ""
for inst in _active[:]: