mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2025-10-31 22:55:18 +00:00
[ie] Do not test truth value of xml.etree.ElementTree.Element (#8582)
Testing the truthiness of an `xml.etree.ElementTree.Element` instance is deprecated in py3.12 Authored by: bashonly
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import re
|
||||
import xml.etree.ElementTree
|
||||
|
||||
from .common import InfoExtractor
|
||||
from ..compat import compat_str
|
||||
@@ -137,7 +138,7 @@ class MTVServicesInfoExtractor(InfoExtractor):
|
||||
mediagen_doc = self._download_xml(
|
||||
mediagen_url, video_id, 'Downloading video urls', fatal=False)
|
||||
|
||||
if mediagen_doc is False:
|
||||
if not isinstance(mediagen_doc, xml.etree.ElementTree.Element):
|
||||
return None
|
||||
|
||||
item = mediagen_doc.find('./video/item')
|
||||
|
||||
Reference in New Issue
Block a user