Skip to content

Commit

Permalink
Adding a check uncomparble values for Literals
Browse files Browse the repository at this point in the history
- A TypeError here can (oddly enough) cause errors in the Literal.__eq__
  • Loading branch information
mwatts15 committed Jul 21, 2019
1 parent af625d0 commit 047e3e9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion rdflib/term.py
Original file line number Diff line number Diff line change
Expand Up @@ -815,7 +815,11 @@ def __gt__(self, other):
if type(self.value) in _TOTAL_ORDER_CASTERS:
caster = _TOTAL_ORDER_CASTERS[type(self.value)]
return caster(self.value) > caster(other.value)
return self.value > other.value

try:
return self.value > other.value
except TypeError:
pass

if text_type(self) != text_type(other):
return text_type(self) > text_type(other)
Expand Down

0 comments on commit 047e3e9

Please sign in to comment.