From 83325e9087e1072cd51fed09896dc92a524db781 Mon Sep 17 00:00:00 2001 From: Raymond Hettinger Date: Wed, 16 Jul 2003 04:32:32 +0000 Subject: [PATCH] Fix faulty doctests. There is no results attribute. Note, these tests were not getting exercised because doctest skips over private functions. --- Lib/difflib.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Lib/difflib.py b/Lib/difflib.py index eb0eccfd38a..a45c0bc503d 100644 --- a/Lib/difflib.py +++ b/Lib/difflib.py @@ -915,8 +915,9 @@ class Differ: Example: >>> d = Differ() - >>> d._fancy_replace(['abcDefghiJkl\n'], 0, 1, ['abcdefGhijkl\n'], 0, 1) - >>> print ''.join(d.results), + >>> results = d._fancy_replace(['abcDefghiJkl\n'], 0, 1, + ... ['abcdefGhijkl\n'], 0, 1) + >>> print ''.join(results), - abcDefghiJkl ? ^ ^ ^ + abcdefGhijkl @@ -1022,9 +1023,9 @@ class Differ: Example: >>> d = Differ() - >>> d._qformat('\tabcDefghiJkl\n', '\t\tabcdefGhijkl\n', - ... ' ^ ^ ^ ', '+ ^ ^ ^ ') - >>> for line in d.results: print repr(line) + >>> results = d._qformat('\tabcDefghiJkl\n', '\t\tabcdefGhijkl\n', + ... ' ^ ^ ^ ', '+ ^ ^ ^ ') + >>> for line in results: print repr(line) ... '- \tabcDefghiJkl\n' '? \t ^ ^ ^\n'