[Python-checkins] python/dist/src/Lib doctest.py,1.37,1.38
tim_one at users.sourceforge.net
tim_one at users.sourceforge.net
Wed Aug 4 22:05:04 CEST 2004
Update of /cvsroot/python/python/dist/src/Lib
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31160/Lib
Modified Files:
doctest.py
Log Message:
Example.__init__: this cannot use assert, because that fails to trigger
in a -O run, and so test_doctest was failing under -O. Simple cause,
simple cure.
Index: doctest.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/doctest.py,v
retrieving revision 1.37
retrieving revision 1.38
diff -C2 -d -r1.37 -r1.38
*** doctest.py 4 Aug 2004 18:46:33 -0000 1.37
--- doctest.py 4 Aug 2004 20:04:31 -0000 1.38
***************
*** 479,484 ****
def __init__(self, source, want, lineno):
# Check invariants.
! assert (source[-1:] == '\n') == ('\n' in source[:-1])
! assert want == '' or want[-1] == '\n'
# Store properties.
self.source = source
--- 479,487 ----
def __init__(self, source, want, lineno):
# Check invariants.
! if (source[-1:] == '\n') != ('\n' in source[:-1]):
! raise AssertionError("source must end with newline iff "
! "source contains more than one line")
! if want and want[-1] != '\n':
! raise AssertionError("non-empty want must end with newline")
# Store properties.
self.source = source
More information about the Python-checkins
mailing list