Use a wrapper around xml.etree.ElementTree.fromstring in python 2.x (#7178)
[youtube-dl] / youtube_dl / utils.py
index a61e47646712791f0b4aa1efd2606b0667cc2b0d..7d846d68085cdbf13e88f116b30b0ad9f2f21b0c 100644 (file)
@@ -36,6 +36,7 @@ import zlib
 from .compat import (
     compat_basestring,
     compat_chr,
+    compat_etree_fromstring,
     compat_html_entities,
     compat_http_client,
     compat_kwargs,
@@ -1974,7 +1975,7 @@ def dfxp2srt(dfxp_data):
 
         return out
 
-    dfxp = xml.etree.ElementTree.fromstring(dfxp_data.encode('utf-8'))
+    dfxp = compat_etree_fromstring(dfxp_data.encode('utf-8'))
     out = []
     paras = dfxp.findall(_x('.//ttml:p')) or dfxp.findall(_x('.//ttaf1:p')) or dfxp.findall('.//p')