[Zope3-checkins] CVS: Zope3/src/zope/component - factory.py:1.11
interfaces.py:1.25
Stephan Richter
srichter at cosmos.phy.tufts.edu
Tue Mar 9 19:59:15 EST 2004
Update of /cvs-repository/Zope3/src/zope/component
In directory cvs.zope.org:/tmp/cvs-serv29452/src/zope/component
Modified Files:
factory.py interfaces.py
Log Message:
Make sure that functions and other non-class objects can also be wrapped as a
factory.
=== Zope3/src/zope/component/factory.py 1.10 => 1.11 ===
--- Zope3/src/zope/component/factory.py:1.10 Tue Mar 9 10:27:31 2004
+++ Zope3/src/zope/component/factory.py Tue Mar 9 19:58:44 2004
@@ -35,4 +35,7 @@
return self._callable(*args, **kw)
def getInterfaces(self):
- return implementedBy(self._callable)
+ try:
+ return implementedBy(self._callable)
+ except AttributeError:
+ return implementedBy(object())
=== Zope3/src/zope/component/interfaces.py 1.24 => 1.25 ===
--- Zope3/src/zope/component/interfaces.py:1.24 Tue Mar 9 10:27:31 2004
+++ Zope3/src/zope/component/interfaces.py Tue Mar 9 19:58:44 2004
@@ -308,7 +308,8 @@
"""Get the interfaces implemented by the factory
Return the interface(s), as an instance of Implements, that objects
- created by this factory will implement.
+ created by this factory will implement. If the callable's Implements
+ instance cannot be created, an empty Implements instance is returned.
"""
More information about the Zope3-Checkins
mailing list