Commit 4f09969b authored by Guido van Rossum's avatar Guido van Rossum

Make this work for Python 1.5.

parent 736b4ca0
#! /usr/bin/env python1.5
# runtest.py
import sys
......@@ -43,7 +45,6 @@ def main():
if not args:
args = glob.glob(os.path.join("test", "test*.xml"))
for arg in args:
print
print arg,
sys.stdout.flush()
save = sys.stdout, sys.argv
......@@ -65,12 +66,24 @@ def main():
expected = f.readlines()
f.close()
stdout.seek(0)
if hasattr(stdout, "readlines"):
actual = stdout.readlines()
else:
actual = readlines(stdout)
if actual == expected:
print "OK"
else:
print "not OK"
showdiff(expected, actual)
def readlines(f):
L = []
while 1:
line = f.readline()
if not line:
break
L.append(line)
return L
if __name__ == "__main__":
main()
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