Skip to content

Commit b81e081

Browse files
Merge pull request #237 from scottsavarese/develop
Don't output close tags if you haven't written a start tag
2 parents e29004a + 048aeab commit b81e081

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

splunklib/modularinput/event_writer.py

100644100755
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,5 +82,6 @@ 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("</stream>")
85+
if self.header_written:
86+
self._out.write("</stream>")
8687
self._out.flush()

0 commit comments

Comments
 (0)