diff --git a/po/update_po.py b/po/update_po.py index 2feac19b5..594402455 100644 --- a/po/update_po.py +++ b/po/update_po.py @@ -169,9 +169,13 @@ def TipsParse(filename, mark): tips = open('../data/tips.xml.in.h', 'w') marklist = root.iter(mark) for key in marklist: - tip = ElementTree.tostring(key, encoding="UTF-8") - tip = tip.replace("", "") - tip = tip.replace('\n<_tip number="%(number)s">' % key.attrib, "") + tip = ElementTree.tostring(key, encoding="UTF-8", method="xml") + if sys.version_info[0] < 3: + tip = tip.replace("", "") + tip = tip.replace('\n<_tip number="%(number)s">' % key.attrib, "") + else: # python3 support + tip = tip.decode("utf-8") + tip = tip.replace('<_tip number="%(number)s">' % key.attrib, "") tip = tip.replace("
", "
") #tip = tip.replace("\n\n", "\n") # special case tip 7 #tip = tip.replace("\n", "") # special case tip 18