chiark / gitweb /
documentation/doxygen: two more ElementTree deprecation warnings.
authorVladimír Vondruš <mosra@centrum.cz>
Sat, 14 Sep 2024 02:06:00 +0000 (04:06 +0200)
committerVladimír Vondruš <mosra@centrum.cz>
Sat, 14 Sep 2024 03:04:52 +0000 (05:04 +0200)
Missed those in 2588ef1a9a5420fa6b0dc39769ce582ce5dc5bd3.

documentation/doxygen.py

index 2418293164165146285d4a698a592aeaa31b171b..d2f4956e4133e35d0e520b5668443874d56a9408 100755 (executable)
@@ -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 <span> 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