From 0523f01333a36bd87be9edb5aab21e3157adc9f3 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Tue, 7 Dec 2010 19:14:22 -0500 Subject: use with_context in .include, also remove bogus sort of filenames --- pyramid/configuration.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pyramid/configuration.py b/pyramid/configuration.py index 60c0220f8..edba82c09 100644 --- a/pyramid/configuration.py +++ b/pyramid/configuration.py @@ -69,6 +69,7 @@ from pyramid.log import make_stream_logger from pyramid.mako_templating import renderer_factory as mako_renderer_factory from pyramid.path import caller_package from pyramid.path import package_path +from pyramid.path import package_of from pyramid.registry import Registry from pyramid.renderers import RendererHelper from pyramid.request import route_request_iface @@ -746,15 +747,14 @@ class Configurator(object): module = inspect.getmodule(func) sourcefiles.append((sourcefile, func, module)) - sourcefiles.sort() - _context = self._ctx for filename, func, module in sourcefiles: context = GroupingContextDecorator(_context) context.basepath = os.path.dirname(filename) context.includepath = _context.includepath + (filename,) - func(self.with_package(module, _ctx=context)) + context.package = package_of(module) + func(Configurator.with_context(context)) def add_handler(self, route_name, pattern, handler, action=None, **kw): -- cgit v1.2.3