[Zope3-checkins] SVN: Zope3/trunk/src/zope/app/form/interfaces.py Temporarily fix a conceptual bug by duck typing. See XXX comment.

Gary Poster gary at zope.com
Fri Feb 25 15:14:27 EST 2005


Log message for revision 29299:
  Temporarily fix a conceptual bug by duck typing.  See XXX comment.
  
  

Changed:
  U   Zope3/trunk/src/zope/app/form/interfaces.py

-=-
Modified: Zope3/trunk/src/zope/app/form/interfaces.py
===================================================================
--- Zope3/trunk/src/zope/app/form/interfaces.py	2005-02-25 20:12:26 UTC (rev 29298)
+++ Zope3/trunk/src/zope/app/form/interfaces.py	2005-02-25 20:14:27 UTC (rev 29299)
@@ -45,7 +45,13 @@
         self.errors = errors
 
     def doc(self):
-        return self.errors.doc()
+        # XXX this duck typing is to get the code working.  See 
+        # collector issue 372
+        if isinstance(self.errors, basestring):
+            return self.errors
+        elif getattr(self.errors, 'doc', None) is not None:
+            return self.errors.doc()
+        return ''
 
 
 class MissingInputError(WidgetInputError):



More information about the Zope3-Checkins mailing list