Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.7k
Closed
Description
Indoctest.py the following ordering is defined for the classDocTest:
def __lt__(self, other): if not isinstance(other, DocTest): return NotImplemented return ((self.name, self.filename, self.lineno, id(self)) < (other.name, other.filename, other.lineno, id(other)))This is incorrect because thelineno field may be an integer and may be None, and comparisons between integers and None fail. Typicallylineno is an integer, but_find_lineno explicitly can fall back to returningNone so the field may be None:
def _find_lineno(self, obj, source_lines): ... # We couldn't find the line number. return None