Pass the request ctx rather than use the globals in the app
The globals have a performance penalty which can be justified for the convinience in user code. In the app however the ctx can easily be passed through the method calls thereby reducing the performance penalty. This may affect extensions if they have subclassed the app and overridden these methods.
This commit is contained in:
parent
74d923515c
commit
d8262aa58c
5 changed files with 80 additions and 42 deletions
|
|
@ -5,7 +5,7 @@ import flask
|
|||
|
||||
def test_suppressed_exception_logging():
|
||||
class SuppressedFlask(flask.Flask):
|
||||
def log_exception(self, exc_info):
|
||||
def log_exception(self, exc_info, ctx):
|
||||
pass
|
||||
|
||||
out = StringIO()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue