diff options
author | mathieui <mathieui@mathieui.net> | 2011-05-04 22:25:26 +0200 |
---|---|---|
committer | mathieui <mathieui@mathieui.net> | 2011-05-04 22:25:26 +0200 |
commit | 0029f4708276699ec656280b5731278e16c2add2 (patch) | |
tree | eb3513e3b016609faaac72029b254e1c28c65d0e /src | |
parent | c93aafa8f5b1e75a9bdfed7edf47ac4a25fcad86 (diff) | |
download | poezio-0029f4708276699ec656280b5731278e16c2add2.tar.gz poezio-0029f4708276699ec656280b5731278e16c2add2.tar.bz2 poezio-0029f4708276699ec656280b5731278e16c2add2.tar.xz poezio-0029f4708276699ec656280b5731278e16c2add2.zip |
Fix python 3.1 compat
Diffstat (limited to 'src')
-rw-r--r-- | src/xhtml.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/xhtml.py b/src/xhtml.py index fee5a118..954db374 100644 --- a/src/xhtml.py +++ b/src/xhtml.py @@ -27,6 +27,7 @@ import re import subprocess from sleekxmpp.xmlstream import ET from xml.etree.ElementTree import ElementTree +from sys import version_info from config import config import logging @@ -82,8 +83,11 @@ def convert_links_to_plaintext(text): parent.text += link_text parent.remove(child) previous_child = child + if version_info.minor <= 1: + return ET.tostring(xml.getroot()) return ET.tostring(xml.getroot(), encoding=str) + def clean_text(string): """ Remove all \x19 from the string |