use try...except a little lower
@@ -153,8 +153,8 @@ def generate_domains_data_from_pyquery(body, fjson_filename):
"""
domain_data = {}
- try:
dl_tags = body('dl')
+
for dl_tag in dl_tags:
dt = dl_tag.findall('dt')
@@ -163,6 +163,7 @@ def generate_domains_data_from_pyquery(body, fjson_filename):
# len(dt) should be equal to len(dd)
# because these tags go together.
for title, desc in zip(dt, dd):
+ try:
id_ = title.attrib.get('id')
if id_:
# clone the PyQuery objects so that
@@ -174,7 +175,6 @@ def generate_domains_data_from_pyquery(body, fjson_filename):
'signature': signature,
'docstrings': docstrings
}
-
except Exception:
log.exception('Error parsing docstrings for domains in file %s', fjson_filename)
