[Python-checkins] python/dist/src/Lib doctest.py,1.65,1.66

edloper at users.sourceforge.net edloper at users.sourceforge.net
Tue Aug 17 18:37:52 CEST 2004


Update of /cvsroot/python/python/dist/src/Lib
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24048/dist/src/Lib

Modified Files:
	doctest.py 
Log Message:
Fixed bug in line-number finding for examples (DocTestParser wasn't
updating line numbers correctly for bare prompts & examples containing
only comments).


Index: doctest.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/doctest.py,v
retrieving revision 1.65
retrieving revision 1.66
diff -C2 -d -r1.65 -r1.66
*** doctest.py	13 Aug 2004 03:55:05 -0000	1.65
--- doctest.py	17 Aug 2004 16:37:12 -0000	1.66
***************
*** 553,562 ****
              # Extract extra options from the source.
              options = self._find_options(source, name, lineno)
-             # If it contains no real source, then ignore it.
-             if self._IS_BLANK_OR_COMMENT(source):
-                 continue
              # Create an Example, and add it to the list.
!             examples.append( Example(source, want, lineno,
!                                      len(m.group('indent')), options) )
              # Update lineno (lines inside this example)
              lineno += string.count('\n', m.start(), m.end())
--- 553,560 ----
              # Extract extra options from the source.
              options = self._find_options(source, name, lineno)
              # Create an Example, and add it to the list.
!             if not self._IS_BLANK_OR_COMMENT(source):
!                 examples.append( Example(source, want, lineno,
!                                          len(m.group('indent')), options) )
              # Update lineno (lines inside this example)
              lineno += string.count('\n', m.start(), m.end())



More information about the Python-checkins mailing list