CVS: Products/PluggableAuthService - utils.py:1.6.2.2

Sidnei da Silva <[email protected]>
Newsgroups gmane.comp.web.zope.public-cvs
Message-ID <[email protected]>
Update of /cvs-repository/Products/PluggableAuthService
In directory cvs.zope.org:/tmp/cvs-serv29327

Modified Files:
      Tag: sidnei-challenge-protocol-chooser
	utils.py 
Log Message:

- Always return a tuple here


=== Products/PluggableAuthService/utils.py 1.6.2.1 => 1.6.2.2 ===
--- Products/PluggableAuthService/utils.py:1.6.2.1	Tue Aug 16 18:21:01 2005
+++ Products/PluggableAuthService/utils.py	Wed Aug 17 15:51:39 2005
@@ -14,20 +14,28 @@
 ##############################################################################
 import os
 import unittest
+from types import TupleType, ListType
 
 from Globals import package_home
 
+def tuplize(value):
+    if isinstance(value, TupleType):
+        return value
+    if isinstance(value, ListType):
+        return tuple(value)
+    return (value,)
+
 try:
     from zope.interface import providedBy
 except ImportError:
     def providedBy(obj):
-        return obj.__implements__
+        return tuplize(obj.__implements__)
 
 try:
     from zope.interface import implementedBy
 except ImportError:
     def implementedBy(klass):
-        return klass.__implements__
+        return tuplize(klass.__implements__)
 
 try:
     from Products.Five.bridge import fromZ2Interface

_______________________________________________
Zope-CVS maillist  -  [email protected]
http://mail.zope.org/mailman/listinfo/zope-cvs

Zope CVS instructions: http://dev.zope.org/CVS
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.