summaryrefslogtreecommitdiffstats
path: root/Lib/doctest.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/doctest.py')
-rw-r--r--Lib/doctest.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/Lib/doctest.py b/Lib/doctest.py
index fe734b3..2774ec1 100644
--- a/Lib/doctest.py
+++ b/Lib/doctest.py
@@ -469,11 +469,12 @@ class DocTest:
# This lets us sort tests by name:
- def __cmp__(self, other):
+ def __lt__(self, other):
if not isinstance(other, DocTest):
- return -1
- return cmp((self.name, self.filename, self.lineno, id(self)),
- (other.name, other.filename, other.lineno, id(other)))
+ return NotImplemented
+ return ((self.name, self.filename, self.lineno, id(self))
+ <
+ (other.name, other.filename, other.lineno, id(other)))
######################################################################
## 3. DocTestParser