[Python-checkins] r70631 - python/branches/py3k/Lib/http/client.py

jeremy.hylton python-checkins at python.org
Thu Mar 26 23:04:05 CET 2009


Author: jeremy.hylton
Date: Thu Mar 26 23:04:05 2009
New Revision: 70631

Log:
Simplify complex expression.


Modified:
   python/branches/py3k/Lib/http/client.py

Modified: python/branches/py3k/Lib/http/client.py
==============================================================================
--- python/branches/py3k/Lib/http/client.py	(original)
+++ python/branches/py3k/Lib/http/client.py	Thu Mar 26 23:04:05 2009
@@ -906,7 +906,9 @@
             self._set_content_length(body)
         for hdr, value in headers.items():
             self.putheader(hdr, value)
-        self.endheaders(body.encode('ascii') if isinstance(body, str) else body)
+        if isinstance(body, str):
+            body = body.encode('ascii')
+        self.endheaders(body)
 
     def getresponse(self):
         """Get the response from the server."""


More information about the Python-checkins mailing list