Skip to content

Commit

Permalink
Support newer lxml versions
Browse files Browse the repository at this point in the history
  • Loading branch information
amercader committed Jun 26, 2024
1 parent 943adbf commit 2b07966
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ckanext/spatial/harvested_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,9 @@ def get_value(self, element):
for child in self.elements:
value[child.name] = child.read_value(element)
return value
elif type(element) == etree._ElementStringResult:
elif hasattr(etree, "_ElementStringResult") and type(element) is etree._ElementStringResult:
value = str(element)
elif type(element) == etree._ElementUnicodeResult:
elif type(element) is etree._ElementUnicodeResult:
value = str(element)
else:
value = self.element_tostring(element)
Expand Down

0 comments on commit 2b07966

Please sign in to comment.