[generic] Fix on python 2.6
[youtube-dl] / youtube_dl / utils.py
index 057cd20d1d70977dd9e56e3d857907a648b228c8..471516b8f6764d26c01818246b95e2e8b20c93fb 100644 (file)
@@ -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)