From ad406f50aea5db8b399e7f9d502c06b6253f8a21 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Sat, 31 Oct 2009 16:21:51 +0000 Subject: Fix default root factory in the face of changes to root factory construction arg. --- repoze/bfg/configuration.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'repoze/bfg/configuration.py') diff --git a/repoze/bfg/configuration.py b/repoze/bfg/configuration.py index 7ea74853c..077b72438 100644 --- a/repoze/bfg/configuration.py +++ b/repoze/bfg/configuration.py @@ -127,12 +127,12 @@ def make_registry(root_factory, package=None, filename='configure.zcml', class DefaultRootFactory: __parent__ = None __name__ = None - def __init__(self, environ): - if 'bfg.routes.matchdict' in environ: - # provide backwards compatibility for applications which - # used routes (at least apps without any custom "context - # factory") in BFG 0.9.X and before - self.__dict__.update(environ['bfg.routes.matchdict']) + def __init__(self, request): + matchdict = getattr(request, 'matchdict', {}) + # provide backwards compatibility for applications which + # used routes (at least apps without any custom "context + # factory") in BFG 0.9.X and before + self.__dict__.update(matchdict) def zcml_configure(name, package): """ Given a ZCML filename as ``name`` and a Python package as -- cgit v1.2.3