[Python-checkins] python/dist/src/Lib rfc822.py,1.79,1.80

rhettinger at users.sourceforge.net rhettinger at users.sourceforge.net
Tue Feb 8 16:39:15 CET 2005


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

Modified Files:
	rfc822.py 
Log Message:
Convert splitlines to for-loop (handles case where input does not have a trailing newline).

Index: rfc822.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/rfc822.py,v
retrieving revision 1.79
retrieving revision 1.80
diff -u -d -r1.79 -r1.80
--- rfc822.py	8 Feb 2005 08:05:13 -0000	1.79
+++ rfc822.py	8 Feb 2005 15:39:11 -0000	1.80
@@ -393,8 +393,8 @@
         del self[name] # Won't fail if it doesn't exist
         self.dict[name.lower()] = value
         text = name + ": " + value
-        self.headers.extend(text.splitlines(True))
-        self.headers.append('\n')
+        for line in text.split("\n"):
+            self.headers.append(line + "\n")
 
     def __delitem__(self, name):
         """Delete all occurrences of a specific header, if it is present."""
@@ -423,8 +423,8 @@
             return self.dict[lowername]
         else:
             text = name + ": " + default
-            self.headers.extend(text.splitlines(True))
-            self.headers.append('\n')
+            for line in text.split("\n"):
+                self.headers.append(line + "\n")
             self.dict[lowername] = default
             return default
 



More information about the Python-checkins mailing list