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