summaryrefslogtreecommitdiff
path: root/Lib/doctest.py
diff options
context:
space:
mode:
authorEzio Melotti <ezio.melotti@gmail.com>2011-09-28 17:37:55 +0300
committerEzio Melotti <ezio.melotti@gmail.com>2011-09-28 17:37:55 +0300
commitd8b509b192a67f0f217ae52ed81fc91bc27a1818 (patch)
treeadab8922723e179e67d546100d19d06d444d7599 /Lib/doctest.py
parenta6e50f589fa328a77b70cde0747f70210c650f49 (diff)
downloadcpython-git-d8b509b192a67f0f217ae52ed81fc91bc27a1818.tar.gz
#13012: use splitlines(keepends=True/False) instead of splitlines(0/1).
Diffstat (limited to 'Lib/doctest.py')
-rw-r--r--Lib/doctest.py6
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)