Skip to content

Commit

Permalink
Merge pull request #926 from mwatts15/master
Browse files Browse the repository at this point in the history
Adding a check uncomparble values for Literals
  • Loading branch information
nicholascar authored Mar 12, 2020
2 parents 1f8e2d0 + 047e3e9 commit 358cd3c
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 @@ -816,7 +816,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 358cd3c

Please sign in to comment.