From: Vladimír Vondruš Date: Sat, 14 Sep 2024 02:06:00 +0000 (+0200) Subject: documentation/doxygen: two more ElementTree deprecation warnings. X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~cjwatson/git?a=commitdiff_plain;h=b1cabb175eb42b8d7ccbd134b314b42567e7909b;p=blog.git documentation/doxygen: two more ElementTree deprecation warnings. Missed those in 2588ef1a9a5420fa6b0dc39769ce582ce5dc5bd3. --- diff --git a/documentation/doxygen.py b/documentation/doxygen.py index 24182931..d2f4956e 100755 --- a/documentation/doxygen.py +++ b/documentation/doxygen.py @@ -2337,7 +2337,11 @@ def parse_define(state: State, element: ET.Element): def _document_all_stuff(compounddef: ET.Element): for i in compounddef.findall('.//briefdescription/..'): brief = i.find('briefdescription') - if not brief and not i.find('detaileddescription'): + # ElementTree deprecated the __bool__ conversion of Element, so I now + # have to check that `detaileddescription` actually has any children. + # Checking against None is not enough as it could be present but be + # empty. + if not len(brief) and not len(i.find('detaileddescription')): # Add an empty to the paragraph so it doesn't look empty. # Can't use strong/emphasis, as those are collapsed if empty as # well; on the other hand it's very unlikely that someone would