Fix python 3.1 compat
This commit is contained in:
parent
c93aafa8f5
commit
0029f47082
1 changed files with 4 additions and 0 deletions
|
@ -27,6 +27,7 @@ import re
|
||||||
import subprocess
|
import subprocess
|
||||||
from sleekxmpp.xmlstream import ET
|
from sleekxmpp.xmlstream import ET
|
||||||
from xml.etree.ElementTree import ElementTree
|
from xml.etree.ElementTree import ElementTree
|
||||||
|
from sys import version_info
|
||||||
|
|
||||||
from config import config
|
from config import config
|
||||||
import logging
|
import logging
|
||||||
|
@ -82,8 +83,11 @@ def convert_links_to_plaintext(text):
|
||||||
parent.text += link_text
|
parent.text += link_text
|
||||||
parent.remove(child)
|
parent.remove(child)
|
||||||
previous_child = child
|
previous_child = child
|
||||||
|
if version_info.minor <= 1:
|
||||||
|
return ET.tostring(xml.getroot())
|
||||||
return ET.tostring(xml.getroot(), encoding=str)
|
return ET.tostring(xml.getroot(), encoding=str)
|
||||||
|
|
||||||
|
|
||||||
def clean_text(string):
|
def clean_text(string):
|
||||||
"""
|
"""
|
||||||
Remove all \x19 from the string
|
Remove all \x19 from the string
|
||||||
|
|
Loading…
Reference in a new issue