Skip to content

Commit

Permalink
fixed deprecated lxml.etree.XPathElementEvaluator evaluate call
Browse files Browse the repository at this point in the history
  • Loading branch information
huberrob committed Mar 19, 2024
1 parent f7f2411 commit e81833c
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions fuji_server/helper/metadata_provider_oai.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def getMetadataStandards(self):
namespaces=OAIMetadataProvider.oai_namespaces,
)
for node in metadata_nodes:
ele = etree.XPathEvaluator(node, namespaces=OAIMetadataProvider.oai_namespaces).evaluate
ele = etree.XPathEvaluator(node, namespaces=OAIMetadataProvider.oai_namespaces) # .evaluate
metadata_prefix = ele(
"string(oai:metadataPrefix/text())"
) # <metadataPrefix>oai_dc</metadataPrefix>
Expand All @@ -79,8 +79,11 @@ def getMetadataStandards(self):
self.metric_id, metadata_prefix
)
)
except:
self.logger.info(f"{self.metric_id} : Could not parse XML response retrieved from OAI-PMH endpoint")
except Exception as e:
self.logger.info(
f"{self.metric_id} : Could not parse XML response retrieved from OAI-PMH endpoint: " + str(e)
)
print("OAI-PMH Parsing Error: ", e)

return schemas

Expand Down

0 comments on commit e81833c

Please sign in to comment.