mirror of
https://github.com/boostorg/boostbook.git
synced 2025-05-11 05:13:58 +00:00
Get run-tests.py working on python 2.5
[SVN r66276]
This commit is contained in:
parent
8ab66ba51e
commit
a0b0e2d73f
@ -40,7 +40,7 @@ def main(argv):
|
|||||||
boostbook_xsl = etree.XSLT(
|
boostbook_xsl = etree.XSLT(
|
||||||
etree.parse(os.path.join(boostbook_directory, "docbook.xsl"), parser)
|
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 parsing boostbook xsl:"
|
||||||
print error
|
print error
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
@ -59,11 +59,16 @@ def main(argv):
|
|||||||
continue
|
continue
|
||||||
|
|
||||||
if (generate_gold):
|
if (generate_gold):
|
||||||
with open(gold_path, 'w') as file:
|
file = open(gold_path, 'w')
|
||||||
|
try:
|
||||||
file.write(doc_text)
|
file.write(doc_text)
|
||||||
|
finally: file.close()
|
||||||
else:
|
else:
|
||||||
with open(gold_path, 'r') as file:
|
file = open(gold_path, 'r')
|
||||||
|
try:
|
||||||
gold_text = file.read()
|
gold_text = file.read()
|
||||||
|
finally:
|
||||||
|
file.close()
|
||||||
compare_xml(filename, doc_text, gold_text)
|
compare_xml(filename, doc_text, gold_text)
|
||||||
|
|
||||||
def run_boostbook(parser, boostbook_xsl, file):
|
def run_boostbook(parser, boostbook_xsl, file):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user