diff options
Diffstat (limited to 'Lib/pprint.py')
-rw-r--r-- | Lib/pprint.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Lib/pprint.py b/Lib/pprint.py index b8417f5..ae96dde 100644 --- a/Lib/pprint.py +++ b/Lib/pprint.py @@ -86,7 +86,11 @@ class _safe_key: self.obj = obj def __lt__(self, other): - rv = self.obj.__lt__(other.obj) + try: + rv = self.obj.__lt__(other.obj) + except TypeError: + rv = NotImplemented + if rv is NotImplemented: rv = (str(type(self.obj)), id(self.obj)) < \ (str(type(other.obj)), id(other.obj)) |