summaryrefslogtreecommitdiff
path: root/Lib/pprint.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/pprint.py')
-rw-r--r--Lib/pprint.py10
1 files changed, 3 insertions, 7 deletions
diff --git a/Lib/pprint.py b/Lib/pprint.py
index c79c713756..723ea9c3dc 100644
--- a/Lib/pprint.py
+++ b/Lib/pprint.py
@@ -86,14 +86,10 @@ class _safe_key:
def __lt__(self, other):
try:
- rv = self.obj.__lt__(other.obj)
+ return self.obj < 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))
- return rv
+ return ((str(type(self.obj)), id(self.obj)) < \
+ (str(type(other.obj)), id(other.obj)))
def _safe_tuple(t):
"Helper function for comparing 2-tuples"