[libxml2] Fix update call in apibuild.py



commit 288c951effecfa1da5b81c8578dccb952afff2fc
Author: Nick Wellnhofer <wellnhofer aevum de>
Date:   Wed Aug 24 00:12:59 2022 +0200

    Fix update call in apibuild.py
    
    There are still a few places where try/except is used for branching.
    This is a bad idea since it can hide errors like this one.

 doc/apibuild.py | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/doc/apibuild.py b/doc/apibuild.py
index 30e4d2dd..8bf8bbd3 100755
--- a/doc/apibuild.py
+++ b/doc/apibuild.py
@@ -192,10 +192,10 @@ class index:
         if name[0:2] == '__':
             return None
         d = None
-        try:
+        if name in self.identifiers:
            d = self.identifiers[name]
-           d.update(header, module, type, lineno, info, extra, conditionals)
-        except:
+           d.update(header, module, type, info, extra, conditionals)
+        else:
            d = identifier(name, header, module, type, lineno, info, extra, conditionals)
            self.identifiers[name] = d
 
@@ -214,10 +214,10 @@ class index:
         if name[0:2] == '__':
             return None
         d = None
-        try:
+        if name in self.identifiers:
            d = self.identifiers[name]
-           d.update(header, module, type, lineno, info, extra, conditionals)
-        except:
+           d.update(header, module, type, info, extra, conditionals)
+        else:
            d = identifier(name, header, module, type, lineno, info, extra, conditionals)
            self.identifiers[name] = d
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]