[Zope-CVS] CVS: Products/VerboseSecurity - UnauthorizedPatch.py:1.2

Shane Hathaway shane@cvs.zope.org
Wed, 21 Aug 2002 15:45:57 -0400


Update of /cvs-repository/Products/VerboseSecurity
In directory cvs.zope.org:/tmp/cvs-serv3197

Modified Files:
	UnauthorizedPatch.py 
Log Message:
Allow positional args and show a cleaner message


=== Products/VerboseSecurity/UnauthorizedPatch.py 1.1.1.1 => 1.2 ===
--- Products/VerboseSecurity/UnauthorizedPatch.py:1.1.1.1	Tue Aug 20 13:09:40 2002
+++ Products/VerboseSecurity/UnauthorizedPatch.py	Wed Aug 21 15:45:56 2002
@@ -29,18 +29,18 @@
 
     _Unauthorized_init = Unauthorized.__init__
 
-    def __init__(self, message=None, **kw):
+    def __init__(self, message=None, *args, **kw):
         """Includes the saved Unauthorized message in the error value.
         """
         if message is None:
             message = ''
         info = getUnauthorizedMessage()
-        if info != message:
+        if info and info != message:
             if message:
-                message = '%s: %s' % (message, info)
+                message = '%s -- %s' % (message, info)
             else:
                 message = info
-        _Unauthorized_init(self, message=message, **kw)
-        
+        _Unauthorized_init(self, message=message, *args, **kw)
+
     Unauthorized.__init__ = __init__