Update the signature of the teardown function (#3730)
Co-authored-by: David Lord <davidism@gmail.com>
This commit is contained in:
parent
fa5aebc842
commit
9d824db41c
1 changed files with 1 additions and 1 deletions
|
|
@ -119,7 +119,7 @@ For example, you can manage a database connection using this pattern::
|
||||||
return g.db
|
return g.db
|
||||||
|
|
||||||
@app.teardown_appcontext
|
@app.teardown_appcontext
|
||||||
def teardown_db():
|
def teardown_db(exception):
|
||||||
db = g.pop('db', None)
|
db = g.pop('db', None)
|
||||||
|
|
||||||
if db is not None:
|
if db is not None:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue