From d76b5f827398520d2d80a96eb38cfb26baaf4188 Mon Sep 17 00:00:00 2001
From: Michael Merickel <michael@merickel.org>
Date: Thu, 13 Jul 2017 03:19:21 +0200
Subject: [PATCH] Merge pull request #3126 from mmerickel/backport-3119-to-1.9-branch

---
 docs/narr/helloworld.py |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/docs/narr/helloworld.py b/docs/narr/helloworld.py
index c01329a..29ed8e6 100644
--- a/docs/narr/helloworld.py
+++ b/docs/narr/helloworld.py
@@ -7,10 +7,9 @@
     return Response('Hello %(name)s!' % request.matchdict)
 
 if __name__ == '__main__':
-    config = Configurator()
-    config.add_route('hello', '/hello/{name}')
-    config.add_view(hello_world, route_name='hello')
-    app = config.make_wsgi_app()
+    with Configurator() as config:
+        config.add_route('hello', '/hello/{name}')
+        config.add_view(hello_world, route_name='hello')
+        app = config.make_wsgi_app()
     server = make_server('0.0.0.0', 8080, app)
     server.serve_forever()
-   

--
Gitblit v1.9.3