From d8b509b192a67f0f217ae52ed81fc91bc27a1818 Mon Sep 17 00:00:00 2001 From: Ezio Melotti Date: Wed, 28 Sep 2011 17:37:55 +0300 Subject: #13012: use splitlines(keepends=True/False) instead of splitlines(0/1). --- Lib/doctest.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Lib/doctest.py') 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) -- cgit v1.2.1