Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 83325e9

Browse files
committed
Fix faulty doctests. There is no results attribute.
Note, these tests were not getting exercised because doctest skips over private functions.
1 parent f359062 commit 83325e9

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

Lib/difflib.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -915,8 +915,9 @@ def _fancy_replace(self, a, alo, ahi, b, blo, bhi):
915915
Example:
916916
917917
>>> d = Differ()
918-
>>> d._fancy_replace(['abcDefghiJkl\n'], 0, 1, ['abcdefGhijkl\n'], 0, 1)
919-
>>> print ''.join(d.results),
918+
>>> results = d._fancy_replace(['abcDefghiJkl\n'], 0, 1,
919+
... ['abcdefGhijkl\n'], 0, 1)
920+
>>> print ''.join(results),
920921
- abcDefghiJkl
921922
? ^ ^ ^
922923
+ abcdefGhijkl
@@ -1022,9 +1023,9 @@ def _qformat(self, aline, bline, atags, btags):
10221023
Example:
10231024
10241025
>>> d = Differ()
1025-
>>> d._qformat('\tabcDefghiJkl\n', '\t\tabcdefGhijkl\n',
1026-
... ' ^ ^ ^ ', '+ ^ ^ ^ ')
1027-
>>> for line in d.results: print repr(line)
1026+
>>> results = d._qformat('\tabcDefghiJkl\n', '\t\tabcdefGhijkl\n',
1027+
... ' ^ ^ ^ ', '+ ^ ^ ^ ')
1028+
>>> for line in results: print repr(line)
10281029
...
10291030
'- \tabcDefghiJkl\n'
10301031
'? \t ^ ^ ^\n'

0 commit comments

Comments
 (0)