2
0
mirror of https://github.com/boostorg/build.git synced 2026-02-16 01:12:13 +00:00

Make test framework not crash when reading nonexistent file

[SVN r64353]
This commit is contained in:
Vladimir Prus
2010-07-26 09:20:54 +00:00
parent 77ee1e6c56
commit 3744ff86cc

View File

@@ -525,7 +525,10 @@ class Tester(TestCmd.TestCmd):
return ''
def read_and_strip(self, name):
lines = open(self.glob_file(name), "rb").readlines()
if not self.glob_file(name):
return ''
f = open(self.glob_file(name), "rb")
lines = f.readlines()
result = string.join(map(string.rstrip, lines), "\n")
if lines and lines[-1][-1] == '\n':
return result + '\n'