[Zope-Checkins] CVS: Zope3/lib/python/Zope/Publisher/HTTP - HTTPResponse.py:1.5

Jim Fulton jim@zope.com
Tue, 18 Jun 2002 15:34:59 -0400


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

Modified Files:
	HTTPResponse.py 
Log Message:
implemented
http://dev.zope.org/Wikis/DevSite/Projects/ComponentArchitecture/ContentSensitiveBrowserMenuConfigurationDirectives



=== Zope3/lib/python/Zope/Publisher/HTTP/HTTPResponse.py 1.4 => 1.5 ===
 from cgi import escape
 
-from Zope.ComponentArchitecture import getAdapter
+from Zope.ComponentArchitecture import queryAdapter
 
 from Zope.Publisher.BaseResponse import BaseResponse
 from Zope.Publisher.Exceptions import Redirect
@@ -276,7 +276,11 @@
 
     def setCharsetUsingRequest(self, request):
         'See Zope.Publisher.HTTP.IHTTPResponse.IHTTPResponse'
-        envadaptor = getAdapter(request, IUserPreferredCharsets)
+        envadaptor = queryAdapter(request, IUserPreferredCharsets)
+        if envadaptor is None:
+            return
+
+        # XXX This try/except lools rather suspicious :(
         try:
             charset = envadaptor.getPreferredCharsets()[0]
         except: