From 412736e783651f21446e62d2406541c9dfc66342 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Thu, 11 Jun 2009 03:38:20 +0000 Subject: We control the horizontal and vertical of request generation now, so there's no purpose in trying to account for non-Webob requests. --- repoze/bfg/router.py | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/repoze/bfg/router.py b/repoze/bfg/router.py index d8a55fe7b..c103d8426 100644 --- a/repoze/bfg/router.py +++ b/repoze/bfg/router.py @@ -1,6 +1,5 @@ from cgi import escape import sys -from webob import Request as WebObRequest from webob import Response from zope.component.event import dispatch @@ -158,21 +157,12 @@ class Router(object): tdict['traversed'], tdict['virtual_root'], tdict['virtual_root_path']) - if isinstance(request, WebObRequest): - # webob.Request's __setattr__ (as of 0.9.5 and lower) - # is a bottleneck; if we're sure we're using a - # webob.Request, go around its back and set stuff into - # the environ directly - attrs = environ.setdefault('webob.adhoc_attrs', {}) - attrs.update(tdict) - else: - request.root = root - request.context = context - request.view_name = view_name - request.subpath = subpath - request.traversed = traversed - request.virtual_root = vroot - request.virtual_root_path = vroot_path + # webob.Request's __setattr__ (as of 0.9.5 and lower) is a + # bottleneck; since we're sure we're using a + # webob.Request, we can go around its back and set stuff + # into the environ directly + attrs = environ.setdefault('webob.adhoc_attrs', {}) + attrs.update(tdict) def respond(response, view_name): registry.has_listeners and registry.notify( -- cgit v1.2.3