Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r66276 - trunk/tools/boostbook/test/more
From: dnljms_at_[hidden]
Date: 2010-10-30 11:50:10


Author: danieljames
Date: 2010-10-30 11:50:06 EDT (Sat, 30 Oct 2010)
New Revision: 66276
URL: http://svn.boost.org/trac/boost/changeset/66276

Log:
Get run-tests.py working on python 2.5
Text files modified:
   trunk/tools/boostbook/test/more/run-tests.py | 11 ++++++++---
   1 files changed, 8 insertions(+), 3 deletions(-)

Modified: trunk/tools/boostbook/test/more/run-tests.py
==============================================================================
--- trunk/tools/boostbook/test/more/run-tests.py (original)
+++ trunk/tools/boostbook/test/more/run-tests.py 2010-10-30 11:50:06 EDT (Sat, 30 Oct 2010)
@@ -40,7 +40,7 @@
         boostbook_xsl = etree.XSLT(
             etree.parse(os.path.join(boostbook_directory, "docbook.xsl"), parser)
         )
- except lxml.etree.XMLSyntaxError as error:
+ except lxml.etree.XMLSyntaxError, error:
         print "Error parsing boostbook xsl:"
         print error
         sys.exit(1)
@@ -59,11 +59,16 @@
                     continue
 
                 if (generate_gold):
- with open(gold_path, 'w') as file:
+ file = open(gold_path, 'w')
+ try:
                         file.write(doc_text)
+ finally: file.close()
                 else:
- with open(gold_path, 'r') as file:
+ file = open(gold_path, 'r')
+ try:
                         gold_text = file.read()
+ finally:
+ file.close()
                     compare_xml(filename, doc_text, gold_text)
 
 def run_boostbook(parser, boostbook_xsl, file):


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