Skip to content

Commit

Permalink
BUGFIX: end() fails with named tags
Browse files Browse the repository at this point in the history
  • Loading branch information
filipsalo committed Apr 11, 2010
1 parent b4875e4 commit 11eba4c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion streamxmlwriter.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ def end(self, tag=None):
"""
open_tag, namespaces, cnames = self._tags.pop()
if tag is not None:
tag = self._cname(tag, namespaces, cnames)
tag , _= self._cname(tag, namespaces, cnames)
if open_tag != tag:
raise XMLSyntaxError("Start and end tag mismatch: %s and /%s."
% (open_tag, tag))
Expand Down
7 changes: 7 additions & 0 deletions test/test_streamxmlwriter.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,13 @@ def testAbbrevEmpty(self):
self.assertEqual(out.getvalue(), "<a></a>")


def testNamedEnd(self):
w, out = writer_and_output()
w.start("a")
w.end("a")
w.close()
self.assertTrue(True)

class PrettyPrintTestCase(unittest.TestCase):
def testSimple(self):
w, out = writer_and_output(pretty_print=True)
Expand Down

0 comments on commit 11eba4c

Please sign in to comment.