[Python-checkins] python/dist/src/Lib difflib.py,1.27,1.28

tim_one at users.sourceforge.net tim_one at users.sourceforge.net
Fri Nov 12 17:12:19 CET 2004


Update of /cvsroot/python/python/dist/src/Lib
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1129/Lib

Modified Files:
	difflib.py 
Log Message:
SF bug 1054821:  difflib HtmlDiff() extra space on inserted 1 character lines

Simple correction from the code's author (Dan Gass).


Index: difflib.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/difflib.py,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -d -r1.27 -r1.28
--- difflib.py	10 Sep 2004 12:58:16 -0000	1.27
+++ difflib.py	12 Nov 2004 16:12:15 -0000	1.28
@@ -1367,8 +1367,8 @@
             text = lines.pop(0)[2:]
             # if line of text is just a newline, insert a space so there is
             # something for the user to highlight and see.
-            if len(text) <= 1:
-                text = ' '+text
+            if not text:
+                text = ' '
             # insert marks that won't be noticed by an xml/html escaper.
             text = '\0' + format_key + text + '\1'
         # Return line of text, first allow user's line formatter to do it's



More information about the Python-checkins mailing list