From d91e5d4d5d0165a7f7599c84c988b981b5fd0d2d Mon Sep 17 00:00:00 2001 From: Steve Piercy <web@stevepiercy.com> Date: Thu, 13 Jul 2017 03:08:05 +0200 Subject: [PATCH] update doxs to use a Configurator context manager --- docs/narr/configuration.rst | 12 ++++++------ 1 files changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/narr/configuration.rst b/docs/narr/configuration.rst index ee54e3a..bbf0124 100644 --- a/docs/narr/configuration.rst +++ b/docs/narr/configuration.rst @@ -47,9 +47,9 @@ return Response('Hello world!') if __name__ == '__main__': - config = Configurator() - config.add_view(hello_world) - app = config.make_wsgi_app() + with Configurator() as config: + config.add_view(hello_world) + app = config.make_wsgi_app() server = make_server('0.0.0.0', 8080, app) server.serve_forever() @@ -116,9 +116,9 @@ return Response('Hello') if __name__ == '__main__': - config = Configurator() - config.scan() - app = config.make_wsgi_app() + with Configurator() as config: + config.scan() + app = config.make_wsgi_app() server = make_server('0.0.0.0', 8080, app) server.serve_forever() -- Gitblit v1.9.3