[Zope-Checkins] CVS: Zope/lib/python/ZPublisher - Publish.py:1.160

Christian Theune ct@gocept.com
Mon, 17 Mar 2003 08:58:44 -0500


Update of /cvs-repository/Zope/lib/python/ZPublisher
In directory cvs.zope.org:/tmp/cvs-serv3049

Modified Files:
	Publish.py 
Log Message:
The real fix for bug 471. The environment didn't truly let us do a simple
try/except so we need to explicitly check.


=== Zope/lib/python/ZPublisher/Publish.py 1.159 => 1.160 ===
--- Zope/lib/python/ZPublisher/Publish.py:1.159	Mon Mar 17 06:12:11 2003
+++ Zope/lib/python/ZPublisher/Publish.py	Mon Mar 17 08:58:43 2003
@@ -58,6 +58,7 @@
      validated_hook, transactions_manager)= get_module_info(module_name)
 
     parents=None
+    response=None
 
     try:
         request.processInputs()
@@ -106,8 +107,10 @@
         if transactions_manager: transactions_manager.abort()
 
         # DM: provide nicer error message for FTP
-        try: sm= response.setMessage
-        except: sm= None
+        sm = None
+        if response is not None:
+            sm = getattr(response, "setMessage", None)
+
         if sm is not None:
             from ZServer.medusa.asyncore import compact_traceback
             cl,val= sys.exc_info()[:2]