Skip to content

Commit 20a86da

Browse files
author
Scott Savarese
committed
Don't output close tags if you haven't written a start tag
1 parent 35ca774 commit 20a86da

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

splunklib/modularinput/event_writer.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,4 +82,5 @@ def write_xml_document(self, document):
8282

8383
def close(self):
8484
"""Write the closing </stream> tag to make this XML well formed."""
85-
self._out.write(b"</stream>")
85+
if self.header_written:
86+
self._out.write(b"</stream>")

0 commit comments

Comments
 (0)