]> granicus.if.org Git - zziplib/commitdiff
docs: dbk2man: fix deprecated way of checking for `None`
authorPatrick Steinhardt <ps@pks.im>
Tue, 21 May 2019 12:24:49 +0000 (14:24 +0200)
committerPatrick Steinhardt <ps@pks.im>
Thu, 1 Aug 2019 06:31:42 +0000 (08:31 +0200)
In oldish versions of Python, it was possible to check for `None` by
simply saying `if not X`, while the newer way would explicitly check `if
X is None`. Use the latter way of asking for None, which has been
supported at least since Python 2.6.

docs/dbk2man.py

index 33eb9058e0781e289f2e8e64c7b71b2d52a7698e..4acc46043a51935626f8d3e3dea85bd087dfcde4 100755 (executable)
@@ -371,7 +371,7 @@ def refentry2(man, refentry, subdirectory = ".", title = ""):
     #
     refpurpose = ""
     section = refentry.find("refnamediv")
-    if not section:
+    if section is None:
         logg.warning("no <refnamediv> found in <refentry> for '%s', bad docbook?", refentrytitle)
         if not refentrytitle: raise Exception("not even a refentrytitle")
         manpages = [ refentrytitle ]