[Zope3-checkins]
SVN: Zope3/branches/ZopeX3-3.0/src/zope/app/cache/caching.py
Add a default parameter so that it doesn't fail badly when
there's no
Sidnei da Silva
sidnei at awkly.org
Tue Jul 6 15:41:36 EDT 2004
Log message for revision 26133:
Add a default parameter so that it doesn't fail badly when there's no
adapter available. It should just return None, so that code using this
will fallback to not using cache.
-=-
Modified: Zope3/branches/ZopeX3-3.0/src/zope/app/cache/caching.py
===================================================================
--- Zope3/branches/ZopeX3-3.0/src/zope/app/cache/caching.py 2004-07-06 19:40:37 UTC (rev 26132)
+++ Zope3/branches/ZopeX3-3.0/src/zope/app/cache/caching.py 2004-07-06 19:41:36 UTC (rev 26133)
@@ -21,7 +21,9 @@
def getCacheForObject(obj):
"""Returns the cache associated with obj or None."""
- adapter = ICacheable(obj)
+ adapter = ICacheable(obj, None)
+ if adapter is None:
+ return None
cache_id = adapter.getCacheId()
if not cache_id:
return None
More information about the Zope3-Checkins
mailing list