[generic] Fix on python 2.6
`ParseError` is not available, it raises `xml.parsers.expat.ExpatError`. The webpage needs to be encoded.
This commit is contained in:
parent
3489b7d26c
commit
f7300c5c90
2 changed files with 8 additions and 2 deletions
|
@ -174,6 +174,11 @@ try:
|
|||
except NameError:
|
||||
compat_chr = chr
|
||||
|
||||
try:
|
||||
from xml.etree.ElementTree import ParseError as compat_xml_parse_error
|
||||
except ImportError: # Python 2.6
|
||||
from xml.parsers.expat import ExpatError as compat_xml_parse_error
|
||||
|
||||
def compat_ord(c):
|
||||
if type(c) is int: return c
|
||||
else: return ord(c)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue