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.
This commit is contained in:
Nick Wellnhofer 2022-08-24 00:12:59 +02:00
parent 92bb889be3
commit 288c951eff

View File

@ -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