[dbapi] 'before-registry-reset' not called for db-api connections, cache may not be initialized
--- a/selectors.py Mon Oct 25 10:18:10 2010 +0200
+++ b/selectors.py Mon Oct 25 10:19:03 2010 +0200
@@ -777,7 +777,11 @@
def score_class(self, eclass, req):
# cache on vreg to avoid reloading issues
- cache = req.vreg._is_instance_selector_cache
+ try:
+ cache = req.vreg._is_instance_selector_cache
+ except AttributeError:
+ # XXX 'before-registry-reset' not called for db-api connections
+ cache = req.vreg._is_instance_selector_cache = {}
try:
expected_eclasses = cache[self]
except KeyError: