Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r64353 - trunk/tools/build/v2/test
From: ghost_at_[hidden]
Date: 2010-07-26 05:20:56


Author: vladimir_prus
Date: 2010-07-26 05:20:54 EDT (Mon, 26 Jul 2010)
New Revision: 64353
URL: http://svn.boost.org/trac/boost/changeset/64353

Log:
Make test framework not crash when reading nonexistent file
Text files modified:
   trunk/tools/build/v2/test/BoostBuild.py | 5 ++++-
   1 files changed, 4 insertions(+), 1 deletions(-)

Modified: trunk/tools/build/v2/test/BoostBuild.py
==============================================================================
--- trunk/tools/build/v2/test/BoostBuild.py (original)
+++ trunk/tools/build/v2/test/BoostBuild.py 2010-07-26 05:20:54 EDT (Mon, 26 Jul 2010)
@@ -525,7 +525,10 @@
             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'


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk