# HG changeset patch # User Sylvain Thénault # Date 1287994743 -7200 # Node ID 9807fb5d5f8d4baf53307926d811e773b25cfa1d # Parent 4b9a785df0f7936d92cb833ec4cef3efda56bd67 [dbapi] 'before-registry-reset' not called for db-api connections, cache may not be initialized diff -r 4b9a785df0f7 -r 9807fb5d5f8d selectors.py --- 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: