From 6d0bbd627c8ff7b6339c894342d00eae11deb7ec Mon Sep 17 00:00:00 2001 From: lord63 Date: Wed, 3 Feb 2016 20:49:02 +0800 Subject: [PATCH 1/2] Fix typo * Use the compatible way to handle the exception. You can find the source code wsgi_app in app.py, and it use the compatible way, so update it * Fix typo in config.py * Fix typo in app.py --- docs/reqcontext.rst | 2 +- flask/app.py | 2 +- flask/config.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/reqcontext.rst b/docs/reqcontext.rst index d7d74fbf..51cd66f6 100644 --- a/docs/reqcontext.rst +++ b/docs/reqcontext.rst @@ -69,7 +69,7 @@ find a piece of code that looks very much like this:: with self.request_context(environ): try: response = self.full_dispatch_request() - except Exception, e: + except Exception as e: response = self.make_response(self.handle_exception(e)) return response(environ, start_response) diff --git a/flask/app.py b/flask/app.py index f75dd818..02d470ed 100644 --- a/flask/app.py +++ b/flask/app.py @@ -421,7 +421,7 @@ class Flask(_PackageBoundObject): #: A dictionary with lists of functions that should be called after #: each request. The key of the dictionary is the name of the blueprint #: this function is active for, ``None`` for all requests. This can for - #: example be used to open database connections or getting hold of the + #: example be used to close database connections or getting hold of the #: currently logged in user. To register a function here, use the #: :meth:`after_request` decorator. self.after_request_funcs = {} diff --git a/flask/config.py b/flask/config.py index d2eeb837..6f643a99 100644 --- a/flask/config.py +++ b/flask/config.py @@ -222,7 +222,7 @@ class Config(dict): app.config['IMAGE_STORE_BASE_URL'] = 'http://img.website.com' image_store_config = app.config.get_namespace('IMAGE_STORE_') - The resulting dictionary `image_store` would look like:: + The resulting dictionary `image_store_config` would look like:: { 'type': 'fs', From 07fdd1930b947b2cc074706ecdfea908ffdb05b9 Mon Sep 17 00:00:00 2001 From: lord63 Date: Thu, 4 Feb 2016 14:33:02 +0800 Subject: [PATCH 2/2] Update app.py --- flask/app.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/flask/app.py b/flask/app.py index 02d470ed..da1998c6 100644 --- a/flask/app.py +++ b/flask/app.py @@ -421,9 +421,8 @@ class Flask(_PackageBoundObject): #: A dictionary with lists of functions that should be called after #: each request. The key of the dictionary is the name of the blueprint #: this function is active for, ``None`` for all requests. This can for - #: example be used to close database connections or getting hold of the - #: currently logged in user. To register a function here, use the - #: :meth:`after_request` decorator. + #: example be used to close database connections. To register a function + #: here, use the :meth:`after_request` decorator. self.after_request_funcs = {} #: A dictionary with lists of functions that are called after @@ -791,8 +790,7 @@ class Flask(_PackageBoundObject): It is not recommended to use this function for development with automatic reloading as this is badly supported. Instead you should - be using the :command:`flask` command line script's ``runserver`` - support. + be using the :command:`flask` command line script's ``run`` support. .. admonition:: Keep in Mind