Update tostring while writing xml

lxml library tostring() accepts only one argument
instead of 2 like it was before. This commit removes
the second argument.

Closes-Bug: 1977869

Signed-off-by: Luis Sampaio <luis.sampaio@windriver.com>
Change-Id: I9bb43a758bb660c8ab6edbf54984ff993b7f8598
This commit is contained in:
Luis Sampaio 2022-06-07 09:20:24 -07:00
parent 9342be978b
commit b94c464a74
3 changed files with 4 additions and 4 deletions

View File

@ -141,7 +141,7 @@ def handle_exception(exc_type, exc_value, exc_traceback):
def write_xml_file(top, fname):
# Generate the file, in a readable format if possible
outfile = open(fname, 'w')
rough_xml = ElementTree.tostring(top, 'utf-8')
rough_xml = ElementTree.tostring(top)
if platform.python_version() == "2.7.2":
# The 2.7.2 toprettyxml() function unnecessarily indents
# childless tags, adding whitespace. In the case of the
@ -1134,7 +1134,7 @@ class PatchRecipeData(object):
def write_xml_file(self, top, fname):
# Generate the file, in a readable format if possible
outfile = open(fname, 'w')
rough_xml = ElementTree.tostring(top, 'utf-8')
rough_xml = ElementTree.tostring(top)
if platform.python_version() == "2.7.2":
# The 2.7.2 toprettyxml() function unnecessarily indents
# childless tags, adding whitespace. In the case of the

View File

@ -500,7 +500,7 @@ class PatchData(object):
# write the modified file
outfile = open(new_filename, 'w')
rough_xml = ElementTree.tostring(root, 'utf-8')
rough_xml = ElementTree.tostring(root)
if platform.python_version() == "2.7.2":
# The 2.7.2 toprettyxml() function unnecessarily indents
# childless tags, adding whitespace. In the case of the

View File

@ -278,7 +278,7 @@ class PatchData(object):
# write the modified file
outfile = open(new_filename, 'w')
rough_xml = ElementTree.tostring(root, 'utf-8')
rough_xml = ElementTree.tostring(root)
if platform.python_version() == "2.7.2":
# The 2.7.2 toprettyxml() function unnecessarily indents
# childless tags, adding whitespace. In the case of the