summaryrefslogtreecommitdiffstats
path: root/rteval/xmlout.py
diff options
context:
space:
mode:
authorDavid Sommerseth <dazo@users.sourceforge.net>2009-03-05 14:56:47 +0100
committerDavid Sommerseth <dazo@users.sourceforge.net>2009-03-05 14:56:47 +0100
commitfa8de99081dd81f6cf7b1fab08eebaed136d1834 (patch)
tree7575a4e49f31461b8c909655813ce1bcd3a9c20a /rteval/xmlout.py
parent3599bd97646f41a64750c199233926ae706c5349 (diff)
downloadrteval-fa8de99081dd81f6cf7b1fab08eebaed136d1834.tar.gz
rteval-fa8de99081dd81f6cf7b1fab08eebaed136d1834.tar.xz
rteval-fa8de99081dd81f6cf7b1fab08eebaed136d1834.zip
Added extra check in XMLOut::close, corrected an error message
Diffstat (limited to 'rteval/xmlout.py')
-rw-r--r--rteval/xmlout.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/rteval/xmlout.py b/rteval/xmlout.py
index 2acc9c7..08a82f1 100644
--- a/rteval/xmlout.py
+++ b/rteval/xmlout.py
@@ -25,6 +25,8 @@ class XMLOut(object):
def close(self):
+ if self.closed:
+ raise RuntimeError, "XMLOut: XML document already closed"
if self.level > 0:
raise RuntimeError, "XMLOut: open blocks at close"
self.xmldoc.appendChild(self.currtag)
@@ -33,7 +35,7 @@ class XMLOut(object):
def Write(self, file, xslt = None):
if not self.closed:
- raise RuntimeError, "XMLOut: XML file is not closed"
+ raise RuntimeError, "XMLOut: XML document is not closed"
if xslt == None:
# If no XSLT template is give, write raw XML