diff options
| author | Benjamin Peterson <benjamin@python.org> | 2011-09-28 10:48:40 -0400 |
|---|---|---|
| committer | Benjamin Peterson <benjamin@python.org> | 2011-09-28 10:48:40 -0400 |
| commit | e56717c3d201db2dadacd20f654d6be7f9ed18ed (patch) | |
| tree | e0df9e7bf6ab16052edaa32311ab66278bc73404 /Lib/doctest.py | |
| parent | 19f6260710b3d086abcbe400194b203be11b60ab (diff) | |
| parent | d8b509b192a67f0f217ae52ed81fc91bc27a1818 (diff) | |
| download | cpython-git-e56717c3d201db2dadacd20f654d6be7f9ed18ed.tar.gz | |
merge heads
Diffstat (limited to 'Lib/doctest.py')
| -rw-r--r-- | Lib/doctest.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/doctest.py b/Lib/doctest.py index be8cc23eb5..9d1501cc18 100644 --- a/Lib/doctest.py +++ b/Lib/doctest.py @@ -1332,7 +1332,7 @@ class DocTestRunner: m = self.__LINECACHE_FILENAME_RE.match(filename) if m and m.group('name') == self.test.name: example = self.test.examples[int(m.group('examplenum'))] - return example.source.splitlines(True) + return example.source.splitlines(keepends=True) else: return self.save_linecache_getlines(filename, module_globals) @@ -1595,8 +1595,8 @@ class OutputChecker: # Check if we should use diff. if self._do_a_fancy_diff(want, got, optionflags): # Split want & got into lines. - want_lines = want.splitlines(True) # True == keep line ends - got_lines = got.splitlines(True) + want_lines = want.splitlines(keepends=True) + got_lines = got.splitlines(keepends=True) # Use difflib to find their differences. if optionflags & REPORT_UDIFF: diff = difflib.unified_diff(want_lines, got_lines, n=2) |
