Log message for revision 111077:
  - removed redundant _unauthorized() call. exception() will call it later in 
the process.
  - removed obsolete code that did support string exceptions
  - some related cleanup

Changed:
  UU  Zope/trunk/src/ZPublisher/HTTPResponse.py

-=-
Modified: Zope/trunk/src/ZPublisher/HTTPResponse.py
===================================================================
--- Zope/trunk/src/ZPublisher/HTTPResponse.py   2010-04-19 09:42:44 UTC (rev 
111076)
+++ Zope/trunk/src/ZPublisher/HTTPResponse.py   2010-04-19 10:00:00 UTC (rev 
111077)
@@ -1,19 +1,18 @@
-#############################################################################
+##############################################################################
 #
 # Copyright (c) 2001 Zope Foundation and Contributors.
 #
 # This software is subject to the provisions of the Zope Public License,
-# Version 2.0 (ZPL).  A copy of the ZPL should accompany this distribution.
+# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
 # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
 # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
-# FOR A PARTICULAR PURPOSE
+# FOR A PARTICULAR PURPOSE.
 #
 ##############################################################################
 '''CGI Response Output formatter
 
 $Id$'''
-__version__ = '$Revision: 1.81 $'[11:-2]
 
 import types, os, sys, re
 import zlib, struct
@@ -247,7 +246,7 @@
         self.errmsg = reason
         # lock the status if we're told to
         if lock:
-             self._locked_status = 1
+            self._locked_status = 1
 
     def setHeader(self, name, value, literal=0, scrubbed=False):
         '''\
@@ -710,7 +709,6 @@
             self.setHeader('WWW-Authenticate', 'basic realm="%s"' % realm, 1)
 
     def unauthorized(self):
-        self._unauthorized()
         m = "<strong>You are not authorized to access this resource.</strong>"
         if self.debug_mode:
             if self._auth:
@@ -724,15 +722,12 @@
                   tag_search=re.compile('[a-zA-Z]>').search,
                   abort=1
                   ):
-        if type(info) is type(()) and len(info) == 3:
+        if isinstance(info, tuple) and len(info) == 3:
             t, v, tb = info
         else:
             t, v, tb = sys.exc_info()
 
-        if t == 'Unauthorized' or t == Unauthorized or (
-            isinstance(t, (type, types.ClassType)) and
-                issubclass(t, Unauthorized)):
-            t = 'Unauthorized'
+        if issubclass(t, Unauthorized):
             self._unauthorized()
 
         stb = tb # note alias between tb and stb


Property changes on: Zope/trunk/src/ZPublisher/HTTPResponse.py
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
   - 1.81

_______________________________________________
Zope-Checkins maillist  -  Zope-Checkins@zope.org
https://mail.zope.org/mailman/listinfo/zope-checkins

Reply via email to