From 7797985dc44576166c77b3bf561d067c2d404104 Mon Sep 17 00:00:00 2001 From: nbauma109 Date: Sat, 30 Mar 2024 15:33:01 +0100 Subject: [PATCH 1/2] Fix issue #12 --- cover2cover.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cover2cover.py b/cover2cover.py index 7cb2d2f..12e8156 100755 --- a/cover2cover.py +++ b/cover2cover.py @@ -143,7 +143,7 @@ def jacoco2cobertura(filename, source_roots): into = ET.Element('coverage') convert_root(root, into, source_roots) print('') - print(ET.tostring(into)) + print(ET.tostring(into, encoding='unicode')) if __name__ == '__main__': if len(sys.argv) < 2: From 017ebec4908333dd56debcba9043370908427b4c Mon Sep 17 00:00:00 2001 From: nbauma109 Date: Sat, 30 Mar 2024 15:56:49 +0100 Subject: [PATCH 2/2] Backward compatibility --- cover2cover.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cover2cover.py b/cover2cover.py index 12e8156..2bafc5d 100755 --- a/cover2cover.py +++ b/cover2cover.py @@ -143,7 +143,10 @@ def jacoco2cobertura(filename, source_roots): into = ET.Element('coverage') convert_root(root, into, source_roots) print('') - print(ET.tostring(into, encoding='unicode')) + if sys.version_info[0] < 3: + print(ET.tostring(into)) + else: + print(ET.tostring(into, encoding='unicode')) if __name__ == '__main__': if len(sys.argv) < 2: