Commit 84f28db6 authored by Tim Peters's avatar Tim Peters

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!
parent 571bb8fc
...@@ -140,20 +140,25 @@ else: ...@@ -140,20 +140,25 @@ else:
pass # not yet on unix pass # not yet on unix
def _test(): def _test():
cmd = "cat"
teststr = "abc\n" teststr = "abc\n"
resultstr = teststr
if os.name == "nt":
cmd = "more"
resultstr = "\n" + resultstr
print "testing popen2..." print "testing popen2..."
r, w = popen2('cat') r, w = popen2(cmd)
w.write(teststr) w.write(teststr)
w.close() w.close()
assert r.read() == teststr assert r.read() == resultstr
print "testing popen3..." print "testing popen3..."
try: try:
r, w, e = popen3(['cat']) r, w, e = popen3([cmd])
except: except:
r, w, e = popen3('cat') r, w, e = popen3(cmd)
w.write(teststr) w.write(teststr)
w.close() w.close()
assert r.read() == teststr assert r.read() == resultstr
assert e.read() == "" assert e.read() == ""
for inst in _active[:]: for inst in _active[:]:
inst.wait() inst.wait()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment