@@ -800,7 +800,7 @@ class Differ:
800800 ... 2. Explicit is better than implicit.
801801 ... 3. Simple is better than complex.
802802 ... 4. Complex is better than complicated.
803- ... '''.splitlines(1 )
803+ ... '''.splitlines(keepends=True )
804804 >>> len(text1)
805805 4
806806 >>> text1[0][-1]
@@ -809,7 +809,7 @@ class Differ:
809809 ... 3. Simple is better than complex.
810810 ... 4. Complicated is better than complex.
811811 ... 5. Flat is better than nested.
812- ... '''.splitlines(1 )
812+ ... '''.splitlines(keepends=True )
813813
814814 Next we instantiate a Differ object:
815815
@@ -896,8 +896,8 @@ def compare(self, a, b):
896896
897897 Example:
898898
899- >>> print(''.join(Differ().compare('one\ntwo\nthree\n'.splitlines(1 ),
900- ... 'ore\ntree\nemu\n'.splitlines(1 ))),
899+ >>> print(''.join(Differ().compare('one\ntwo\nthree\n'.splitlines(True ),
900+ ... 'ore\ntree\nemu\n'.splitlines(True ))),
901901 ... end="")
902902 - one
903903 ? ^
@@ -1269,8 +1269,8 @@ def context_diff(a, b, fromfile='', tofile='',
12691269
12701270 Example:
12711271
1272- >>> print(''.join(context_diff('one\ntwo\nthree\nfour\n'.splitlines(1 ),
1273- ... 'zero\none\ntree\nfour\n'.splitlines(1 ), 'Original', 'Current')),
1272+ >>> print(''.join(context_diff('one\ntwo\nthree\nfour\n'.splitlines(True ),
1273+ ... 'zero\none\ntree\nfour\n'.splitlines(True ), 'Original', 'Current')),
12741274 ... end="")
12751275 *** Original
12761276 --- Current
@@ -1339,8 +1339,8 @@ def ndiff(a, b, linejunk=None, charjunk=IS_CHARACTER_JUNK):
13391339
13401340 Example:
13411341
1342- >>> diff = ndiff('one\ntwo\nthree\n'.splitlines(1 ),
1343- ... 'ore\ntree\nemu\n'.splitlines(1 ))
1342+ >>> diff = ndiff('one\ntwo\nthree\n'.splitlines(keepends=True ),
1343+ ... 'ore\ntree\nemu\n'.splitlines(keepends=True ))
13441344 >>> print(''.join(diff), end="")
13451345 - one
13461346 ? ^
@@ -2034,8 +2034,8 @@ def restore(delta, which):
20342034
20352035 Examples:
20362036
2037- >>> diff = ndiff('one\ntwo\nthree\n'.splitlines(1 ),
2038- ... 'ore\ntree\nemu\n'.splitlines(1 ))
2037+ >>> diff = ndiff('one\ntwo\nthree\n'.splitlines(keepends=True ),
2038+ ... 'ore\ntree\nemu\n'.splitlines(keepends=True ))
20392039 >>> diff = list(diff)
20402040 >>> print(''.join(restore(diff, 1)), end="")
20412041 one
0 commit comments