From 277df8ebad5b9c6a3f45618354d7c3c96f55e247 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Sun, 10 May 2009 22:00:56 +0000 Subject: Minor speed and docs tweaks. --- repoze/bfg/urldispatch.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'repoze') diff --git a/repoze/bfg/urldispatch.py b/repoze/bfg/urldispatch.py index d3baf6d9f..ead8876de 100644 --- a/repoze/bfg/urldispatch.py +++ b/repoze/bfg/urldispatch.py @@ -115,6 +115,9 @@ class RoutesContextNotFound(object): def __init__(self, msg): self.msg = msg +_notfound = RoutesContextNotFound( + 'Routes context cannot be found and no fallback "get_root"') + class RoutesRootFactory(Mapper): """ The ``RoutesRootFactory`` is a wrapper for the ``get_root`` callable passed in to the repoze.bfg ``Router`` at initialization @@ -193,11 +196,8 @@ class RoutesRootFactory(Mapper): return context if self.get_root is None: - # no fallback get_root - return RoutesContextNotFound( - 'Routes context cannot be found and no fallback "get_root"') + return _notfound - # fall back to original get_root return self.get_root(environ) class RoutesModelTraverser(object): -- cgit v1.2.3