Skip to content

Commit

Permalink
test_engine_junit.py: don't mix different types in a single variable
Browse files Browse the repository at this point in the history
  • Loading branch information
berquist committed Jan 14, 2025
1 parent c43d63f commit f3740ad
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/sst/core/testingframework/test_engine_junit.py
Original file line number Diff line number Diff line change
Expand Up @@ -441,11 +441,12 @@ def junit_to_xml_report_string(
if prettyprint:
# minidom.parseString() works just on correctly encoded binary strings
xml_string = xml_string.encode(encoding or "utf-8")
xml_string = xml.dom.minidom.parseString(xml_string)
xml_string_document = xml.dom.minidom.parseString(xml_string)
# toprettyxml() produces unicode if no encoding is being passed
# or binary string with an encoding
xml_string = xml_string.toprettyxml(encoding=encoding)
if encoding:
xml_string = xml_string_document.toprettyxml(encoding=encoding)
if isinstance(xml_string, bytes):
assert encoding is not None
xml_string = xml_string.decode(encoding)
# is unicode now
return xml_string
Expand Down

0 comments on commit f3740ad

Please # to comment.