From 047e3e9781a28966ff9b6fd46ec20e459a5a0f11 Mon Sep 17 00:00:00 2001 From: Mark Watts Date: Sun, 21 Jul 2019 10:48:23 -0500 Subject: [PATCH] Adding a check uncomparble values for Literals - A TypeError here can (oddly enough) cause errors in the Literal.__eq__ --- rdflib/term.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/rdflib/term.py b/rdflib/term.py index 3665ff221..11dca4ee4 100644 --- a/rdflib/term.py +++ b/rdflib/term.py @@ -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)