[Zope-Checkins] CVS: Zope3/lib/python/Zope/Publisher/Browser - BrowserResponse.py:1.4

Barry Warsaw barry@wooz.org
Fri, 14 Jun 2002 15:22:43 -0400


Update of /cvs-repository/Zope3/lib/python/Zope/Publisher/Browser
In directory cvs.zope.org:/tmp/cvs-serv27669

Modified Files:
	BrowserResponse.py 
Log Message:
setBody(): Minor code cleanups: use isinstance() and 'not in' where
appropriate.


=== Zope3/lib/python/Zope/Publisher/Browser/BrowserResponse.py 1.3 => 1.4 ===
         200 if it has not already been set.
         """
-
-        if type(body) not in StringTypes:
+        if not isinstance(body, StringTypes):
             body = unicode(body)
 
-        if not ('content-type' in self._headers):
+        if 'content-type' not in self._headers:
             c = (self.__isHTML(body) and 'text/html' or 'text/plain')
             if self._charset is not None:
-                c += ';charset='+self._charset
+                c += ';charset=' + self._charset
             self.setHeader('content-type', c)
 
         body = self.__insertBase(body)