From 3744ff86cc4e8489d64ae6e0559d27a60b99bf63 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Mon, 26 Jul 2010 09:20:54 +0000 Subject: [PATCH] Make test framework not crash when reading nonexistent file [SVN r64353] --- v2/test/BoostBuild.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/v2/test/BoostBuild.py b/v2/test/BoostBuild.py index 6be72abed..8c5024f15 100644 --- a/v2/test/BoostBuild.py +++ b/v2/test/BoostBuild.py @@ -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'