[Zope3-checkins] CVS: Zope3/lib/python/Zope/App/Caching/RAMCache - RAMCache.py:1.2
Steve Alexander
steve@cat-box.net
Mon, 11 Nov 2002 09:26:57 -0500
Update of /cvs-repository/Zope3/lib/python/Zope/App/Caching/RAMCache
In directory cvs.zope.org:/tmp/cvs-serv5494/lib/python/Zope/App/Caching/RAMCache
Modified Files:
RAMCache.py
Log Message:
removed bare except: clauses. Made try: blocks more specific.
=== Zope3/lib/python/Zope/App/Caching/RAMCache/RAMCache.py 1.1 => 1.2 ===
--- Zope3/lib/python/Zope/App/Caching/RAMCache/RAMCache.py:1.1 Thu Oct 31 11:01:39 2002
+++ Zope3/lib/python/Zope/App/Caching/RAMCache/RAMCache.py Mon Nov 11 09:26:56 2002
@@ -21,6 +21,7 @@
from time import time
from thread import allocate_lock
from Zope.ComponentArchitecture import getAdapter
+from Zope.ComponentArchitecture.Exceptions import ComponentLookupError
# A global caches dictionary shared between threads
caches = {}
@@ -106,7 +107,7 @@
self.requestVars, keywords)
try:
return s.getEntry(location, key)
- except:
+ except KeyError:
return default
def set(self, data, ob, view_name='', keywords=None):
@@ -173,10 +174,11 @@
try:
locatable = getAdapter(event.object, IPhysicallyLocatable)
+ except ComponentLookupError:
+ pass
+ else:
location = locatable.getPhysicalPath()
self._getStorage().invalidate(location)
- except:
- pass
class Storage: